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:
mariano.iglesias 2008-05-01 19:35:12 +00:00
parent 2aff396611
commit c585658c27

View file

@ -477,6 +477,9 @@ class CakeTestCase extends UnitTestCase {
}
$attrs = array();
foreach ($attributes as $attr => $val) {
if (is_numeric($attr) && preg_match('/^preg\:\/(.+)\/$/i', $val, $matches)) {
$attrs[] = $matches[1];
} else {
if (is_numeric($attr)) {
$attr = $val;
$val = '.*?';
@ -487,6 +490,7 @@ class CakeTestCase extends UnitTestCase {
}
$attrs[] = '[\s]+'.preg_quote($attr, '/').'="'.$val.'"';
}
}
if ($attrs) {
$permutations = $this->__array_permute($attrs);
$regex[] = '(';