我刚刚发布了一些Fixtures和一些TestCases,每当我运行 使用烘焙工具自动烘烤灯具和测试。 我检查了 vendor / bin / phpunit code> 我得到以下错误的版本: p>
$ vendor / bin / phpunit
PHPUnit 4.7.7 by Sebastian Bergmann和贡献者。
感知:无法插入灯具 “App \ Test \ TestCase \ Controller \ ScreensControllerTest”测试用例。 SQLSTATE [HY000] [2002]在[/Applications/MAMP/htdocs/myapp/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureManager.php,第254行]中没有这样的文件或目录
code> pre>
$ fixtures code>属性中的每个项目对应于
tests / Fixture / code>中的文件。 如果我在任何测试类中注释掉
$ fixtures code>声明,那么错误就会转移到下一个类。 所以在任何特定的灯具/测试中语法都不错。 p>
div>
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.