Matthew Weier O'Phinney wrote:
> Bruno --
>
> I sent an email yesterday, but I don't see it in the archives, so I'll
> ask again: Can you send both the bootstrap you use, the controller being
> tested, and the test case? It's really hard to debug when I don't have
> the information needed to reproduce the issue.
Effectively no mail yesterday :-)
>
> I know that Zend_Test works fine with sessions, as the example I
> developed for the documentation -- the login form example -- utilizes
> Zend_Session, and works. The issue here is likely something to do with
> either (a) whitespace appearing before or after a class definition, or
> (b) the environment you setup for your application. Both are
> correctible.
I haven't notice the fact that the doc sample work with session.
So I will first try to reread carrefully and better understand each pieces.
In case I found a no go, I will forward you the bootstrap and related materials
(I've lots of thing inside it)
and the test I'm trying to initiate.
I will try to not bother you to much you during the zendcon week ... ( too late
and a bit too far to join you there :-) )
>
> -- Bruno Friedmann <[EMAIL PROTECTED]> wrote
> (on Thursday, 11 September 2008, 06:53 PM +0200):
>> 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
>>
>>
>
--
Bruno Friedmann
Ioda-Net Sàrl
2830 Vellerat - Switzerland
Tél : ++41 32 435 7171
Fax : ++41 32 435 7172
gsm : ++41 78 802 6760
www.ioda-net.ch
Centre de Formation et de Coaching En Ligne
www.cfcel.com