ZF-6600: testConstructorShouldAcceptResourceLoaderInOptions(Zend_Application_Module_BootstrapTest) unit tests failure
Description
{panel} 1) testConstructorShouldAcceptResourceLoaderInOptions(Zend_Application_Module_BootstrapTest) array_merge_recursive(): recursion detected /home/cawa/ZendFramework/svn/framework/branches/release-1.8/library/Zend/Application/Bootstrap/BootstrapAbstract.php:135 /home/cawa/ZendFramework/svn/framework/branches/release-1.8/library/Zend/Application/Bootstrap/BootstrapAbstract.php:135 /home/cawa/ZendFramework/svn/framework/branches/release-1.8/library/Zend/Application/Module/Bootstrap.php:65 {panel}
Comments
Posted by Alexander Veremyev (alexander) on 2009-05-11T03:43:23.000+0000
The root of the problem is array_merge_recursive() behavior. It processes objects like an arrays and does this in astrange way.
E.g. the following code:
is processed without errors and gives the following result: {panel} array(1) { ["key"]=> object(A)#1 (1) { ["a"]=> int(1) } } array(1) { ["key"]=> array(1) { ["a"]=> array(2) { [0]=> int(1) [1]=> int(1) } } } {panel}
In the same time
gives another result: {panel} array(1) { ["key"]=> object(A)#1 (1) { ["a"]=> int(2) } }
Warning: array_merge_recursive(): recursion detected in /home/cawa/ZendFramework/laboratory/test3.php on line 17 array(1) { ["key"]=> array(1) { ["a"]=> int(2) } } {panel}
array_merge_recursive() has probably be replaced with array_merge or foreach (...) structure
Posted by Matthew Weier O'Phinney (matthew) on 2009-05-11T04:58:36.000+0000
I'm unable to reproduce this behavior; can you test with current updates,please?
Posted by Matthew Weier O'Phinney (matthew) on 2009-05-12T08:06:03.000+0000
I replaced array_merge_recursive with a custom recursive merge in all Zend_App classes that needed it, and I cannot reproduce the error at this point.