php - Error with PHPUnit in Symfony2 -


i have error phpunit using symfony2

in test case import:

use symfony\bundle\frameworkbundle\test\webtestcase; 

but, when execute get:

php fatal error:  class 'symfony\bundle\frameworkbundle\test\webtestcase' not found in c:\trabajo\web\company\src\company\webbundle\tests\dbtest.php on line 11 

i use execute it:

phpunit -c app/ src/company/webbundle/tests/dbtest

any help?

thanks in advance.

this because execute test case cli need provide

  • boostrap file /app/bootstrap.php.cache
  • configuration file app/phpunit.xml.dist

so command below:

phpunit --configuration app/phpunit.xml.dist ----bootstrap /app/bootstrap.php.cache 

bootstrap can provided in phpunit.xml.dist within <phpunit> tag.

the other option assuming have phpunit.xml.dist file go app directory , there execute tests.

you may adjust paths needs.


Comments