Changeset 31890
- Timestamp:
- 01/24/11 19:03:26 (2 years ago)
- Files:
-
- branches/1.3/lib/util/sfDomCssSelector.class.php (modified) (1 diff)
- branches/1.3/test/unit/util/sfDomCssSelectorTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.3/lib/util/sfDomCssSelector.class.php
r29521 r31890 161 161 foreach ($founds as $found) 162 162 { 163 if (preg_match('/ \b'.$className.'\b/', $found->getAttribute('class')))163 if (preg_match('/(^|\s+)'.$className.'($|\s+)/', $found->getAttribute('class'))) 164 164 { 165 165 $nodes[] = $found; branches/1.3/test/unit/util/sfDomCssSelectorTest.php
r29158 r31890 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(7 1);13 $t = new lime_test(72); 14 14 15 15 $html = <<<EOF … … 109 109 110 110 $t->is($c->matchAll('#nonexistant')->getValues(), array(), '->matchAll() returns an empty array if the id does not exist'); 111 112 $t->is($c->matchAll('.bar1-foo1')->getValues(), array('link', 'another link'), 'Hyphenated class names are matched correctly'); 111 113 112 114 $t->diag('attribute selectors');