CakePHP 3: unable to insert lights when running phpunit

I just baked some lights and some test applications, 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] 

Lamps and tests were baked automatically using baking tools. I checked that every element in the $fixtures property corresponds to a file in tests/Fixture/ . If I comment on the declaration of $fixtures in any of the test classes, the error simply proceeds to the next class. Thus, this is not a bad syntax in any particular instrument / test.

+7
php unit-testing cakephp phpunit
source share
1 answer

This error means that PHP cannot connect to the database. If you are using an SQLite database, make sure that the directory is writable and exists.

+5
source share

All Articles