ZF-2590: Unit test error: testAtomSample3(Zend_Feed_ImportTest)

Description


There was 1 failure:

1) testAtomSample3(Zend_Feed_ImportTest)
Failed asserting that  is true.
Expected Zend_Feed_Exception to be thrown
Failed asserting that  is true.
/Users/weppos/Sites/zend.com.framework/trunk/tests/Zend/Feed/ImportTest.php:424
/Users/weppos/Sites/zend.com.framework/trunk/tests/Zend/Feed/ImportTest.php:136

Comments

I investigated the issue and this is caused by XDebug.

According to the following comment http://php.benscom.com/manual/en/… the variable $php_errormsg is not populated if you have XDebug running.

It means the variable will be used for the first time, in case of loadXML statement failure. The following line

{quote} throw new Zend_Feed_Exception("DOMDocument cannot parse XML: $php_errormsg"); {quote}

will generate a PHP notice

{quote} Undefined variable: php_errormsg {quote}

retrown by PHPUnit as a PHPUnit_Framework_Notice exception.

{quote} 1) testAtomSample3(Zend_Feed_ImportTest) Failed asserting that is an instance of class "Zend_Feed_Exception". /Users/weppos/Sites/zend.com.framework/trunk/tests/Zend/Feed/ImportTest.php:424 /Users/weppos/Sites/zend.com.framework/trunk/tests/Zend/Feed/ImportTest.php:136 {quote}

The test fails because PHPUnit_Framework_Notice is not an instance of Zend_Feed_Exception.

Fixed in r7830

Changed target to mini release (merged to branch at 8009)