1
I’m trying to set up Phpunit in Zend, but it’s giving an error when I run phpunit on the terminal.
error:
$ phpunit PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.' in /media/candidosouza/Development/GITHUB/Learning-ZF2/03-ZF2-Avancado/module/CJSN/tests/Bootstrap.php:75
My Bootstrap class, taken from the documentation
Error is falling on this Bootstrap class IF:
if (!$zf2Path) {
throw new RuntimeException(
'Unable to load ZF2. Run `php composer.phar install` or'
. ' define a ZF2_PATH environment variable.'
);
}
My files are set up as in the documentation! Can anyone tell me why that mistake!
How do I fix it?
Thank you!!!
run the command
composer install
, orcomposer.phar install
, for all paths to be mounted– user6406
Hello André Henriques! Everything is already installed! This Composer run message only happens because of if in the Bootstrap class, but all my components are installed
– José
Thank you for your attention André!!!
– José
I’m sorry for not answering, I just looked at the error and put the comment, because reponder I can not, because long ago I do not use zend.
– user6406
the phpunit dependency has been placed in the Composer file?
– user6406
Hello André, is not not, it already comes installed in Zend! When you first install the dependencies with Composer, it is already installed automatically...
– José