2009/9/19 Sudheer Satyanarayana <[email protected]> > On Friday 18 September 2009 07:09 PM, Sudheer Satyanarayana wrote: > >> the tutorial recommends including a test class that extends >> Zend_Test_PHPUnit_ControllerTestCase in the test bootstrap. I think it is a >> bit awkward for your ModelTest and LibraryTest classes to extend a class >> that in turn extends Zend_Test_PHPUnit_ControllerTestCase. >> > I've not seen the zend cast, but in my applications I have my controller tests extend Zend_Test_PHPUnit_ControllerTestCase, and my model tests just extend PHPUnit_Framework_TestCase.
> I tried to bootstrap the application in my test like below: >> [code] >> $application = new Zend_Application(APPLICATION_ENV,APPLICATION_PATH . >> '/configs/application.ini'); >> $application->bootstrap(); >> [/code] >> >> But I get PHP session warnings because the user running tests is unable to >> write to /var/some/path/apache/is/able/to/write/to. >> Zend_Test_PHPUnit_ControllerTestCase mysteriously circumvents this. > > Again, this is a wild stab in the dark, but I have: Zend_Session::$_unitTestEnabled = true; in my TestHelper.php (run at the start of testing), which magically fixes a lot of sessions related test problems. Ideally your tests should be simulating session related stuff rather than actually creating PHP sessions I think. -- Tim Fountain http://tfountain.co.uk/
