Просмотр исходного кода

patching issue ZF-9478 with patch from Giorgio

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@22561 44c647ce-9c0f-0410-b52a-842ac1e357ba
dragonbe 15 лет назад
Родитель
Сommit
b74fa98b5a

+ 2 - 0
library/Zend/Test/PHPUnit/Constraint/DomQuery.php

@@ -293,6 +293,8 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint
      */
     protected function _matchContent($result, $match)
     {
+        $match = (string) $match;
+
         if (0 == count($result)) {
             return false;
         }

+ 2 - 0
tests/Zend/Test/PHPUnit/ControllerTestCaseTest.php

@@ -305,6 +305,8 @@ class Zend_Test_PHPUnit_ControllerTestCaseTest extends PHPUnit_Framework_TestCas
         $this->testCase->assertQuery('div#foo legend.bat', $body);
         $this->testCase->assertNotQuery('div#foo legend.bogus', $body);
         $this->testCase->assertQueryContentContains('legend.bat', 'La di da', $body);
+        $this->testCase->assertQueryContentContains('legend.numeric', 42, $body);
+        $this->testCase->assertNotQueryContentContains('legend.numeric', 31, $body);
         $this->testCase->assertNotQueryContentContains('legend.bat', 'La do da', $body);
         $this->testCase->assertQueryContentRegex('legend.bat', '/d[a|i]/i', $body);
         $this->testCase->assertNotQueryContentRegex('legend.bat', '/d[o|e]/i', $body);

+ 3 - 0
tests/Zend/Test/PHPUnit/_files/application/views/scripts/zend-test-php-unit-foo/baz.phtml

@@ -12,6 +12,9 @@
     <fieldset>
         <legend class="bat">La di da</legend>
     </fieldset>
+    <fieldset>
+        <legend class="numeric">42</legend>
+    </fieldset>
 </div>
 </body>
 </html>