PHPUnit run directory of tests
I just upgraded PHPStorm this morning and now my PHPUnit configuration, which is set to run all the tests in a directory won't run.
Here is the configuration window:

When I run this configuration I get:
PDOException : SQLSTATE[HY000] [2002] No such file or directory
/Users/jackal/Sites/ogl/virtualinvite/models/Model.php:49
/Users/jackal/Sites/ogl/virtualinvite/tests/unit/models/AffiliateModelTest.php:25
on all the tests in the directory.
And if I run the tests individually they work fine:
Time: 162 ms, Memory: 12.25Mb
OK (6 tests, 7 assertions)
Process finished with exit code 0
The 'run' command is basically the same:
/usr/bin/php /private/var/folders/0q/rvm29w6x54v1src5cx6yd8zm0000gn/T/ide-phpunit.php --bootstrap /Users/jackal/Sites/ogl/virtualinvite/tests/unit/bootstrap.php --no-configuration AffiliateModelTest /Users/jackal/Sites/ogl/virtualinvite/tests/unit/models/AffiliateModelTest.php
vs
/usr/bin/php /private/var/folders/0q/rvm29w6x54v1src5cx6yd8zm0000gn/T/ide-phpunit.php --bootstrap /Users/jackal/Sites/ogl/virtualinvite/tests/unit/bootstrap.php --no-configuration /Users/jackal/Sites/ogl/virtualinvite/tests/unit/models
I know the error message is telling me that PHP can't find MySQL. I can't figure out why. Both run configurations are using the same bootstrap, which is where the connection to the database takes place:
$dbh = new PDO('mysql:dbname=ogl;host=127.0.0.1', '*********', '***********');
Thoughts?
Please sign in to leave a comment.
Hello,
Is it the same when you run tests from the command line?