Re: [fw-general] Problem with autoloading and unit testing Zend_Application
Hello Ralph tanks for posting. This is exactly the way i setup my testing environment. Here are the source code. bootstrap.php ControllerTestCase.php bootstrap = array($this, 'appBootstrap'); parent::setUp(); $this->getFrontController()->setParam( 'bootstrap', $this->application->getBootstrap() ); } public function appBootstrap() { $this->application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $this->application->bootstrap(); } } ?> IndexControllerTest.php dispatch('/'); $this->assertController('index'); $this->assertAction('index'); } } ?> But the autoloading dont works :( Best regards Aycko Ralph Schindler-2 wrote: > > Mostly you should note that just as your application would bootstrap, so > does your testing environment. > > This means that you need to have an Zend_Application being setup, and it > would bootstrap as normal. This would assume that your bootstrap class > probably has a method to setup your autoloading too. > > http://maff.ailoo.net/2009/04/set-up-a-zend-framework-application-using-zend_application-including-phpunit-setup/#add-unit-testing > > Let me know if that link gets you going, > Ralph > > Aycko wrote: >> Push. >> >> >> Aycko wrote: >>> All classes which are loaded with Zend_Application_Module_Autoloader in >>> module bootrap could not be found. The autoloaders are defined in >>> application bootstrap and module bootstrap ... this works great, but not >>> fpr testing. >>> Defining the Zend_Application_Module_Autoloaders in bootstrap file in >>> tests folder dont works. Including the missing miles via require_once >>> works, but this is not very comfortable. >>> >>> >>> funkyfly wrote: Can you provide more detailed information about the fatal error? -- Regards, Vladas Diržys On Fri, Sep 25, 2009 at 13:18, Aycko wrote: > > > Aycko wrote: >> Hello together, >> >> i set up a basic environment for unit testing my Zend_Application. >> >> A basic test looks something like this: >> >> public function testDefaultControllerAndAction() { >> $this->dispatch('/'); >> $this->assertController('index'); >> $this->assertAction('index'); >> } >> >> Calling phpunit in command line causes some php fatal errors. All > classes >> which are loaded with Zend_Application_Module_Autoloader in module > bootrap >> could not be found. >> >> Are there any solution without setting up all requires manually? >> >> >> Best regards >> Aycko >> > Any ideas? > -- > View this message in context: > http://www.nabble.com/Problem-with-autoloading-and-unit-testing-Zend_Application-tp25534200p25609668.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > >>> >> > > -- View this message in context: http://www.nabble.com/Problem-with-autoloading-and-unit-testing-Zend_Application-tp25534200p25711725.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Problem with autoloading and unit testing Zend_Application
Mostly you should note that just as your application would bootstrap, so does your testing environment. This means that you need to have an Zend_Application being setup, and it would bootstrap as normal. This would assume that your bootstrap class probably has a method to setup your autoloading too. http://maff.ailoo.net/2009/04/set-up-a-zend-framework-application-using-zend_application-including-phpunit-setup/#add-unit-testing Let me know if that link gets you going, Ralph Aycko wrote: Push. Aycko wrote: All classes which are loaded with Zend_Application_Module_Autoloader in module bootrap could not be found. The autoloaders are defined in application bootstrap and module bootstrap ... this works great, but not fpr testing. Defining the Zend_Application_Module_Autoloaders in bootstrap file in tests folder dont works. Including the missing miles via require_once works, but this is not very comfortable. funkyfly wrote: Can you provide more detailed information about the fatal error? -- Regards, Vladas Diržys On Fri, Sep 25, 2009 at 13:18, Aycko wrote: Aycko wrote: Hello together, i set up a basic environment for unit testing my Zend_Application. A basic test looks something like this: public function testDefaultControllerAndAction() { $this->dispatch('/'); $this->assertController('index'); $this->assertAction('index'); } Calling phpunit in command line causes some php fatal errors. All classes which are loaded with Zend_Application_Module_Autoloader in module bootrap could not be found. Are there any solution without setting up all requires manually? Best regards Aycko Any ideas? -- View this message in context: http://www.nabble.com/Problem-with-autoloading-and-unit-testing-Zend_Application-tp25534200p25609668.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Problem with autoloading and unit testing Zend_Application
Push. Aycko wrote: > > All classes which are loaded with Zend_Application_Module_Autoloader in > module bootrap could not be found. The autoloaders are defined in > application bootstrap and module bootstrap ... this works great, but not > fpr testing. > Defining the Zend_Application_Module_Autoloaders in bootstrap file in > tests folder dont works. Including the missing miles via require_once > works, but this is not very comfortable. > > > funkyfly wrote: >> >> Can you provide more detailed information about the fatal error? >> -- >> Regards, >> Vladas Diržys >> >> >> On Fri, Sep 25, 2009 at 13:18, Aycko wrote: >> >>> >>> >>> >>> Aycko wrote: >>> > >>> > Hello together, >>> > >>> > i set up a basic environment for unit testing my Zend_Application. >>> > >>> > A basic test looks something like this: >>> > >>> > public function testDefaultControllerAndAction() { >>> > $this->dispatch('/'); >>> > $this->assertController('index'); >>> > $this->assertAction('index'); >>> > } >>> > >>> > Calling phpunit in command line causes some php fatal errors. All >>> classes >>> > which are loaded with Zend_Application_Module_Autoloader in module >>> bootrap >>> > could not be found. >>> > >>> > Are there any solution without setting up all requires manually? >>> > >>> > >>> > Best regards >>> > Aycko >>> > >>> >>> Any ideas? >>> -- >>> View this message in context: >>> http://www.nabble.com/Problem-with-autoloading-and-unit-testing-Zend_Application-tp25534200p25609668.html >>> Sent from the Zend Framework mailing list archive at Nabble.com. >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Problem-with-autoloading-and-unit-testing-Zend_Application-tp25534200p25693457.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Problem with autoloading and unit testing Zend_Application
All classes which are loaded with Zend_Application_Module_Autoloader in module bootrap could not be found. The autoloaders are defined in application bootstrap and module bootstrap ... this works great, but not fpr testing. Defining the Zend_Application_Module_Autoloaders in bootstrap file in tests folder dont works. Including the missing miles via require_once works, but this is not very comfortable. funkyfly wrote: > > Can you provide more detailed information about the fatal error? > -- > Regards, > Vladas Diržys > > > On Fri, Sep 25, 2009 at 13:18, Aycko wrote: > >> >> >> >> Aycko wrote: >> > >> > Hello together, >> > >> > i set up a basic environment for unit testing my Zend_Application. >> > >> > A basic test looks something like this: >> > >> > public function testDefaultControllerAndAction() { >> > $this->dispatch('/'); >> > $this->assertController('index'); >> > $this->assertAction('index'); >> > } >> > >> > Calling phpunit in command line causes some php fatal errors. All >> classes >> > which are loaded with Zend_Application_Module_Autoloader in module >> bootrap >> > could not be found. >> > >> > Are there any solution without setting up all requires manually? >> > >> > >> > Best regards >> > Aycko >> > >> >> Any ideas? >> -- >> View this message in context: >> http://www.nabble.com/Problem-with-autoloading-and-unit-testing-Zend_Application-tp25534200p25609668.html >> Sent from the Zend Framework mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Problem-with-autoloading-and-unit-testing-Zend_Application-tp25534200p25641333.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Problem with autoloading and unit testing Zend_Application
Can you provide more detailed information about the fatal error? -- Regards, Vladas Diržys On Fri, Sep 25, 2009 at 13:18, Aycko wrote: > > > > Aycko wrote: > > > > Hello together, > > > > i set up a basic environment for unit testing my Zend_Application. > > > > A basic test looks something like this: > > > > public function testDefaultControllerAndAction() { > > $this->dispatch('/'); > > $this->assertController('index'); > > $this->assertAction('index'); > > } > > > > Calling phpunit in command line causes some php fatal errors. All classes > > which are loaded with Zend_Application_Module_Autoloader in module > bootrap > > could not be found. > > > > Are there any solution without setting up all requires manually? > > > > > > Best regards > > Aycko > > > > Any ideas? > -- > View this message in context: > http://www.nabble.com/Problem-with-autoloading-and-unit-testing-Zend_Application-tp25534200p25609668.html > Sent from the Zend Framework mailing list archive at Nabble.com. > >
Re: [fw-general] Problem with autoloading and unit testing Zend_Application
Aycko wrote: > > Hello together, > > i set up a basic environment for unit testing my Zend_Application. > > A basic test looks something like this: > > public function testDefaultControllerAndAction() { > $this->dispatch('/'); > $this->assertController('index'); > $this->assertAction('index'); > } > > Calling phpunit in command line causes some php fatal errors. All classes > which are loaded with Zend_Application_Module_Autoloader in module bootrap > could not be found. > > Are there any solution without setting up all requires manually? > > > Best regards > Aycko > Any ideas? -- View this message in context: http://www.nabble.com/Problem-with-autoloading-and-unit-testing-Zend_Application-tp25534200p25609668.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Problem with autoloading and unit testing Zend_Application
Hello together, i set up a basic environment for unit testing my Zend_Application. A basic test looks something like this: public function testDefaultControllerAndAction() { $this->dispatch('/'); $this->assertController('index'); $this->assertAction('index'); } Calling phpunit in command line causes some php fatal errors. All classes which are loaded with Zend_Application_Module_Autoloader in module bootrap could not be found. Are there any solution without setting up all requires manually? Best regards Aycko -- View this message in context: http://www.nabble.com/Problem-with-autoloading-and-unit-testing-Zend_Application-tp25534200p25534200.html Sent from the Zend Framework mailing list archive at Nabble.com.