ZF-12077: Zend_Test_PHPUnit_ControllerTestCase::assertQueryContentContains(,'0') fails for content '0'

Issue Type: Bug Created: 2012-03-01T10:57:45.000+0000 Last Updated: 2012-03-05T18:21:30.000+0000 Status: Open Fix version(s): Reporter: Andreas Heigl (heiglandreas) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Test_PHPUnit

  • zf-crteam-review

Related issues: Attachments: - DomQueryPatch


Testing the following XML with Zend_Test_PHPUnit_ControllerTestCase::assertQueryContentContains('content','0') fails due to type-conversion. ```

The Zend_Test_PHPUnit_Constraint_DomQuery::_matchContent()-method uses strstr to check for the existence of *0* in the string *0* and returns *0*. The surrounding if then interprets this as false and returns an unexpected value.

Using strpos instead of strstr results in the expected return value of the method.

The attatched Patch-File will change the strstr call to a strpos-call for the file Zend_Test_PHPUnit_Constraint_DomQuery


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.