首页 > 解决方案 > 未执行任何测试 - 验收测试 Codeception

问题描述

当我尝试使用 codeception 运行验收测试时,我得到了同样的错误。

C:\Users\DEFAULT.DESKTOP-RJ3G5I9\vendor\bin>codecept run acceptance GoogleTest.php
Codeception PHP Testing Framework v4.1.6
Powered by PHPUnit 9.2.6 by Sebastian Bergmann and contributors.
Running with seed:

class TestGoogle
{
    public function testGoogle(AcceptanceTester $I)
    {
        $I->amOnPage('https://www.google.com');
                $I->see('Google');
    }
}
Acceptance Tests (0) ---------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
No tests executed!

Anybody has any idea on that? Thanks 

标签: codeception

解决方案


您错过了在 GoogleTest.php 文件顶部打开 PHP 标记。

类名也必须具有匹配其格式的后缀。
您在这里使用 Cest 格式,因此类和文件必须相应地命名为 GoogleCest 和 GoogleCest.php。


推荐阅读