mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-30 13:43:00 +00:00
CakeTestCase::assertTags() now allows regular expressions for an entire attribute / attribute set
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6744 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
2aff396611
commit
c585658c27
1 changed files with 11 additions and 7 deletions
|
@ -477,6 +477,9 @@ class CakeTestCase extends UnitTestCase {
|
||||||
}
|
}
|
||||||
$attrs = array();
|
$attrs = array();
|
||||||
foreach ($attributes as $attr => $val) {
|
foreach ($attributes as $attr => $val) {
|
||||||
|
if (is_numeric($attr) && preg_match('/^preg\:\/(.+)\/$/i', $val, $matches)) {
|
||||||
|
$attrs[] = $matches[1];
|
||||||
|
} else {
|
||||||
if (is_numeric($attr)) {
|
if (is_numeric($attr)) {
|
||||||
$attr = $val;
|
$attr = $val;
|
||||||
$val = '.*?';
|
$val = '.*?';
|
||||||
|
@ -487,6 +490,7 @@ class CakeTestCase extends UnitTestCase {
|
||||||
}
|
}
|
||||||
$attrs[] = '[\s]+'.preg_quote($attr, '/').'="'.$val.'"';
|
$attrs[] = '[\s]+'.preg_quote($attr, '/').'="'.$val.'"';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($attrs) {
|
if ($attrs) {
|
||||||
$permutations = $this->__array_permute($attrs);
|
$permutations = $this->__array_permute($attrs);
|
||||||
$regex[] = '(';
|
$regex[] = '(';
|
||||||
|
|
Loading…
Add table
Reference in a new issue