Running a single test with PHPStorm opens it in the browser Follow
I'm having a problem here with PHPUnit testing on PHPStorm. When clicking 'Run' the tests directory, it does what I expect and runs it as a test. But when I click 'Run' on a single test file, it opens it in the browser instead of running it as a test.
How can I configure PHPStorm to run those files as tests so I can run a single test and not the whole suite every time?
Please sign in to leave a comment.
You might be doing something wrong ... or it tries to run previously created (temp) Run/Debug Configuration that is of "PHPUnit by HTTP" or something like that.
Use "Run | Edit Configurations..." or drop-down box on toolbar (next to Run/Debug buttons) to check your existing configurations.
This 1 screenshot looks OK for me.
Could you please illustrate what and where do you click when you run that "single test"?
Right-Click on the php file and then Run. For some reason it works fine for ConcertTest.php (Unit folder), but ViewConcertsListingTest.php (Feature folder) opens in the browser. Both configurations are identical to the one I posted above (except for the Directory field of course).
I'm sorry .. but I want to see the screenshot. There is a chance that whatever you are clicking there is not related to actual PHPUnit at all... and screenshot should clarify that.
>Right-Click on the php file and then Run.
Sorry for not being more clear. I want screenshot of that -- the content menu item that you are clicking on.
Your PHPUnit configurations are fine.
I had the same problem, and the the resolution above worked. It's worth to note the root cause was that the class I was trying to 'run' did not extend the base `TestCase` class, thus could not be tested by phpunit.