Bruno Friedmann wrote:
> I'm facing a problem how to do this.
> 
> I've a application bootstrap which relies on Zend_Session. And I want to test 
> controllers with the new (not so)
> Zend_Test_PHPUnit_ControllerTestCase.
> 
> It's the first time I've to do this so excuse me for the newb questions.
> 
> I've follow the documentation and also the Mathew post blog and wiki.
> 
> On a simple "Hello world example " tests are working nicely. (not too 
> difficult, but just here to prove the env is correctly setup)
> 
> So when I launch my test on the complicate bootstrap I've received this error 
> :
> 
> PHPUnit 3.2.21 by Sebastian Bergmann.
> 
> IndexControllerTest
> E
> 
> Time: 0 seconds
> 
> There were 1 errors:
> 
> 1) testIndexAction(IndexControllerTest)
> Zend_Session_Exception: Session must be started before any output has been 
> sent to the browser; output started in
> /usr/share/php5/PEAR/PHPUnit/Util/Printer.php/139
> /ioda/data/web-include/ZF/library.160/Zend/Session/Namespace.php:116
> /home/bruno/workspace/socketfinder/sf/ZfApplication.php:155
> /home/bruno/workspace/socketfinder/sf/ZfApplication.php:118
> /home/bruno/workspace/socketfinder/sf/ZfApplication.php:98
> /home/bruno/workspace/socketfinder/sf/tests/Sf/controllers/IndexControllerTest.php:22
> 
> I'm pretty sure I would have to do some sort of ouput_buffering but google 
> was not my friend today.
> It only give me what phpunit session conference I've missed.
> 
> Any path to a solution or any advice are welcome.
> 

Ok a little step futher
I've found that we can change this.
Zend_Session::$_unitTestEnabled = true;

but I've always a error ...

testIndexAction(IndexControllerTest)
Undefined variable: _SESSION
/ioda/data/web-include/ZF/library.160/Zend/Session.php:522
/ioda/data/web-include/ZF/library.160/Zend/Session.php:448
/ioda/data/web-include/ZF/library.160/Zend/Session/Namespace.php:116
/home/bruno/workspace/socketfinder/sf/ZfApplication.php:156



-- 

     Bruno Friedmann


Reply via email to