I am developing a nice application that seems to be running fine, I’ve started to add some PHPUnit tests to the project. However whenever I try and run a test I get the following error:
Zend_Cache_Exception: file Zend/Cache/Backend/Memcache.php not found in include_path
When I look into that path of the file system, there is no Memcache.php, only Memcached.php.
The full stacktrace from the phpunit run looks like this.
1) IndexControllerTest::testIndexAction Zend_Cache_Exception: file
Zend/Cache/Backend/Memcache.php not found in include_path/opt/www/development/app/library/Zend/Cache.php:209
/opt/www/development/app/library/Zend/Cache.php:148
/opt/www/development/app/library/Zend/Cache.php:94
/opt/www/development/app/library/Zend/Cache/Manager.php:173
/opt/www/development/app/application/Bootstrap.php:64
/opt/www/development/app/library/Zend/Application/Bootstrap/BootstrapAbstract.php:667
/opt/www/development/app/library/Zend/Application/Bootstrap/BootstrapAbstract.php:620
/opt/www/development/app/library/Zend/Application/Bootstrap/BootstrapAbstract.php:584
/opt/www/development/app/library/Zend/Application.php:355
/opt/www/development/app/library/Zend/Test/PHPUnit/ControllerTestCase.php:155
/opt/www/development/app/library/Zend/Test/PHPUnit/ControllerTestCase.php:136
/opt/www/development/app/tests/application/controllers/IndexControllerTest.php:9
Any idea why this is being thrown when running unit tests but not when I run the application fully?
Thanks in advance.
The name of the cache is
Memcached, notMemcache. Without seeing your code I can’t say why you don’t get an error outside of unit testing.Zend_Cache::_makeBackend()will throw an exception if the file doesn’t exist or the class isn’t found.