Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View ZF-9765.patch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
Index: tests/Zend/Dom/QueryTest.php
===================================================================
--- tests/Zend/Dom/QueryTest.php (revision 22034)
+++ tests/Zend/Dom/QueryTest.php (working copy)
@@ -243,6 +243,32 @@
$this->assertTrue(is_array($errors));
$this->assertTrue(0 < count($errors));
}
+
+ /**
+ * @group ZF-9765
+ */
+ public function testCssSelectorShouldFindNodesWhenMatchingMultipleAttributes()
+ {
+ $html = <<<EOF
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<body>
+ <form action="#" method="get">
+ <input type="hidden" name="foo" value="1" id="foo"/>
+ <input type="hidden" name="bar" value="0" id="bar"/>
+ <input type="hidden" name="baz" value="1" id="baz"/>
+ </form>
+</body>
+</html>
+EOF;
+
+ $this->query->setDocument($html);
+ $results = $this->query->query('input[type="hidden"][value="1"]');
+ $this->assertEquals(2, count($results));
+ $results = $this->query->query('input[type="hidden"][value="0"]');
+ $this->assertEquals(1, count($results));
+ }
}
// Call Zend_Dom_QueryTest::main() if this source file is executed directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.