Skip to content

@hobodave /ZF-9765.patch
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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.