ZF-8797: Using Zend_Test_PHPUnit_ControllerTestCase with Zend_Application,The Resources shuold be reset

Issue Type: Bug Created: 2010-01-12T21:02:03.000+0000 Last Updated: 2010-10-28T00:40:37.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Tomoaki Kosugi (noopable) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Test_PHPUnit

Related issues: - ZF-10607



It is relative to rev:18604 Please add Zend_Application::resetResoruce() and exec it in Zend_Test_PHPUnit_ControllerTestCase::reset()

For example, Zend_Test_PHPUnit_ControllerTestCase::bootstrap() resets the frontcontroller by resetInstance() and gets the frontcontroller same instance from Zend_Application. But it cannot be initialized by Zend_Application::bootstrap() because the bootstrap has it statically. As a result the frontcontroller instance is not designed but is a plain instance.

If all the Zend_Application's Resources are also reset in the Zend_Test_PHPUnit_ControllerTestCase::reset(), that

<pre class="highlight">
$this->_frontController = $this->bootstrap->getBootstrap()->getResource('frontcontroller');

will be return the just designed instance.


Posted by Matthew Weier O'Phinney (matthew) on 2010-01-13T08:20:46.000+0000

This should now be resolved in trunk.

Posted by Tomoaki Kosugi (noopable) on 2010-01-14T13:33:32.000+0000

I'm sorry and thank you. Now it works fine.

I made a bootstrap in TestHelper and registered it to the Registry and use it in ControllerTestCase::setUp before this problem resoleved . But now nomally use. $this->bootstrap = new Zend_Application(.......

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.