Search code examples
phpzend-frameworkphpunitpearphpstorm

how to do unit testing with phpstorm and zend framework?


i am trying to run some testing on my framework with phpstorm.

i am working with xampp and i have php unit installed.

the framework is located:

C:\xampp\htdocs\zend\zend\application\
C:\xampp\htdocs\zend\zend\library\
C:\xampp\htdocs\zend\zend\library\zend\...
...

the php interpreter i set up is php 5.4.4

when i run the testing i get

C:\xampp\php\php.exe C:\Users\test\AppData\Local\Temp\ide-phpunit.php --no-configuration C:\xampp\htdocs\zend\zend Testing started at 2:24 PM ...

Warning: require_once(Zend/Cache/Backend/ExtendedInterface.php): failed to open stream: No such file or directory in C:\xampp\htdocs\zend\zend\library\Zend\Cache\Backend\Test.php on line 27

Fatal error: require_once(): Failed opening required 'Zend/Cache/Backend/ExtendedInterface.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\zend\zend\library\Zend\Cache\Backend\Test.php on line 27

Process finished with exit code 255

in Test.php in the zend library there is an include require_once 'Zend/Cache/Backend/ExtendedInterface.php'; and it seems that the ide can't figure out the path.

any ideas on this issue?

thanks


Solution

  • You need to configure additional include paths. I suggest you do that with your project settings. To do that, double click External Libraries External Libraries at the end of the Project Tool Window.

    When you call the unit tests, PHPStorm will automatically add those.

    Just add the Zend Framework path as an include path and you should have solved these problems.