小编Col*_*ynn的帖子

设置CakePHP 3插件测试

我曾经bin/cake bake plugin PluginName创建过一个插件.部分原因是它创建phpunit.xml.dist,但烘焙不会创建所需的文件夹结构或tests/bootstrap.php文件.

问题

我运行时收到"未执行测试"消息phpunit:

$ phpunit
PHPUnit 5.1.3 by Sebastian Bergmann and contributors.

Time: 239 ms, Memory: 4.50Mb

No tests executed!
Run Code Online (Sandbox Code Playgroud)

背景资料

我在我的插件文件夹下创建了我的测试tests/TestCase.我不认为它们是问题,但我会在最后发布它们.

我正在使用默认phpunit.xml.dist文件,我正在使用它tests/bootstrap.php:

$findRoot = function ($root) {
    do {
        $lastRoot = $root;
        $root = dirname($root);
        if (is_dir($root . '/vendor/cakephp/cakephp')) {
            return $root;
        }
    } while ($root !== $lastRoot);
    throw new Exception("Cannot find the root of the application, unable to run tests");
}; …
Run Code Online (Sandbox Code Playgroud)

testing configuration phpunit cakephp cakephp-3.0

5
推荐指数
1
解决办法
1442
查看次数

标签 统计

cakephp ×1

cakephp-3.0 ×1

configuration ×1

phpunit ×1

testing ×1