views:

55

answers:

2

Hi there,

I asked the same question in another forum, but I don't yet have any luck there. So please allow me to ask the same question here.

I want to setup Zend_Test to test my controller code (I am using PHP, Zend Framework). Everything seems to be correct and according to the official documentation, but I kept getting an error.

For the detailed explanation about the problem and my setup, please refer to the forum post here. Anyone can give me a clue, what's wrong with my setup?

Thanks! Regards, Andree.

A: 

Check out this Tutorial , and follow it step by step. Works fine for me.

Tutorial PHPUNIT + Zend Framework

ArneRie
+1  A: 

I've had this problem before when using setFallbackAutoloader(true), which you are, but I've never been able to track down the root cause. If you Google the error you'll find a few ZF bug reports mentioning it.

Can you confirm that you are also using setFallbackAutoloader(true) in your application? If not, then you can remove that line from your TestHelper.php. If you are, then try adding:

$autoLoader->suppressNotFoundWarnings(true);

just after it, this normally fixes the problem for me (but may cause some other issues).

Tim Fountain
Yes, I'm not using fallback autloader in my application, but I set one in TestHelper.php. After I remove the line and register namespace manually, the test is running fine. Thanks Tim!
Andree