I just baked some Fixtures and some TestCases and whenever I run vendor/bin/phpunit
I get a version of the following error:
$ vendor/bin/phpunit
PHPUnit 4.7.7 by Sebastian Bergmann and contributors.
IException: Unable to insert fixtures for "App\Test\TestCase\Controller\ScreensControllerTest" test case. SQLSTATE[HY000] [2002] No such file or directory in [/Applications/MAMP/htdocs/myapp/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureManager.php, line 254]
The fixtures and tests were baked automatically using the bake tools. I checked that each item in the $fixtures
property corresponds to a file in tests/Fixture/
. If I comment out the $fixtures
declaration in any of the test classes the error just moves to the next class. So it's not bad syntax in any specific fixture/test.
This error means that PHP is not able to connect to the database. If you are using a SQLite database, make sure the directory is writable and exists.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With