>
> One note with the above: you've got some duplication of logic. All of
> the controller directories you add using setControllerDirectory() should
> have already been added with the addModuleDirectory() statement.
>
I thought I had to add them separate. Thanks for the hint.
Matthew Weier O'Phinney-3 wrote:
>
> I'm a little unclear -- is this src/index.php, or public/index.php? Some
> of the settings below are ones that have either been done in the
> TestHelper.php above, or are inappropriate for a non-HTTP environment.
> Could you clarify?
>
It's my only bootstrap file. It's src/index.php. I have following structure:
src
intranet
config
layout
assets
css
images
js
scripts
modules
dashboard
controllers
views
pppservice
build
config
controllers
models
views
index.php -> the bootstrap file
Matthew Weier O'Phinney-3 wrote:
>
>> header('content-type: text/html; charset=UTF-8');
>
> Also, in your test bootstraps, you shouldn't call header(), as header()
> issues a notice in the PHPUnit environment. I'd typically recommend that
> a header such as the above be injected into your response object
> instead, which will make the application more testable as well. You
> could do so either in a plugin, or in the bootstrap (and just make sure
> you inject the response object into the front controller prior to
> dispatching).
>
> That one is in the bootstrap file of my application. So if I make sure
>
>> set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__)
>> .
>> '/library');
>>
>> require_once 'Zend/Loader.php';
>> Zend_Loader::registerAutoload();
>
> The above statements would not be necessary if this is the bootstrap for
> your testing, as they're already covered in TestHelper.php...
>
> set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) .
> '/library');
This one I deleted because it has been a forgotten fragment. My Framework
lies in PEAR so my include Path has not to be set up again at this point.
But because that's the bootstrap of my application I need the other lines.
Matthew Weier O'Phinney-3 wrote:
>
>> // now dispatch
>> try {
>>
>> $front->dispatch();
>
> Also, in your test bootstrap, you wouldn't dispatch the front
> controller... so I'm guessing this is your public bootstrap?
>
>
You guess right. Sorry for not mentioning it :(
Matthew Weier O'Phinney-3 wrote:
>
> dispatch() expects a URI -- prepend it with a slash:
>
> $this->dispatch('/pppservice/weekplanner');
>
> and that may make a difference here.
>
I'll try following your advice and hope I'll get it soon :) On top of that
someone suggested your bugapp to me. I think additionally I look at it so
that I hopefully better understand the technique behind.
But thanks for the good advice - I think I will solve the problem with it :)
With kind regards,
Steffi
-----
--
Stefanie Zeiger
angehende Medieninformatikerin (Bachelor BA)
s.zeiger@trio-group.de
--
View this message in context: http://www.nabble.com/Zend_Test-isn%27t-working-with-my-application-tp21628300p21706768.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论