Can't get Symfony 2 to work with PHPstorm

I've installed the symfony plugin to PHPstorm, but when I'm trying to run the project I get the following error

Fatal error: Class 'Doctrine\Tests\Common\Cache\CacheTest' not found in ...

I've checked the path and CacheTest file is in the correct folder. When I run the symfony project from the command line it works just fine.

Is there someway to fix this problem?

Answers


What you try is not correct. You execute the php.exe and that is the normal PHP executable. To run your Unit-Tests you need PHPUnit to run.

Go to Preferences -> Languages & Frameworks -> PHP -> PHPUnit and define the phpunit.phar.

When you've done that you create a new configuration to run PHPUnit and you define the configuration which is under app/phpunit.xml.


I figured it out. First of all you need add phpunit.phar as Stony explained in his answer.

After that all I really needed to do was to rename phpunit.xml.dist to phpunit.xml in app/ folder and then just right click it and choose the Run 'phpunit.xml' option. This way the Tests succeed and it doesn't give any errors.

As for running the symfony project you need to add symfony command line tool support to phpstorm. All about that in this link: https://confluence.jetbrains.com/display/PhpStorm/Symfony2+Command+Line+Tool+Integration+-+Symfony+Development+using+PhpStorm

After that you just run it as a command like you would with normal command line. That's also explained in the link.


Try to choose "Use custom autoloader" option in Preferences -> Languages & Frameworks -> PHP -> PHPUnit and specify the path to vendor/autoload.php file.


Need Your Help

Pause android DownloadManager

android android-download-manager

In my application I'm downloading movies from the server. Some of them are very big (4gb or more). I tried to implement my own download manager as a service and it was not quit good. On some device...

Is Log4cplus really so slow?

c++ performance logging pantheios log4cplus

I've been testing three options for my logging subsystem in C++. One is Log4cplus, one is Pantheios and the last one is a simple logging library that we have written ourselves.