droirqk4795 2015-07-16 15:27
浏览 50
已采纳

CakePHP 3:运行phpunit时无法插入灯具

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.

  • 写回答

1条回答 默认 最新

  • douju2012 2015-07-16 20:46
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 CSS通配符清除内外边距为什么可以覆盖默认样式?
  • ¥15 SPSS分类模型实训题步骤
  • ¥15 求解决扩散模型代码问题
  • ¥15 工创大赛太阳能电动车项目零基础要学什么
  • ¥20 limma多组间分析最终p值只有一个
  • ¥15 nopCommerce开发问题
  • ¥15 torch.multiprocessing.spawn.ProcessExitedException: process 1 terminated with signal SIGKILL
  • ¥15 QuartusⅡ15.0编译项目后,output_files中的.jdi、.sld、.sof不更新怎么解决
  • ¥15 pycharm输出和导师的一样,但是标红
  • ¥15 想问问富文本拿到的html怎么转成docx的