Skip to content

Instantly share code, notes, and snippets.

@hobodave
Created April 28, 2010 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hobodave/382547 to your computer and use it in GitHub Desktop.
Save hobodave/382547 to your computer and use it in GitHub Desktop.
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