I am setting up testing with PHPUnit and Zend Framework and have a niggling issue with autoloading.
Firstly, I'm not sure why I need to setup autoloading in my the phpunit bootstrap.php. In the production environment, the index.php file isn't loading it? (My test cases are extending Zend_Test_PHPUnit_ControllerTestCase).
Secondly, I'm having difficulty replacing Zend_Loader with Zend_Loader_Autoload.
If I use this code in my bootstrap...
require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();
... the tests run fine, but with a warning about Zend_Loader being deprecated.
If I use this code, however...
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
The tests can't find a library class and a fatal error results.
In my application.ini I have the line autoloaderNamespaces[] = "CP_". It seems that the Loader class can see it, but not the Autoloader class. Curious...
Any ideas?
Thanks!