Laravel / codeception问题带有测试注释[Phpunit \ Framework \ Warning]&quot&quot @covers \ testController :: __ construct"无效
我在测试中的@covers注释有问题(诸如:@doesnotperformassertions这样的注释很好)。
codeception.sh无所事事...主要是在沙盒中进行测试。
php:
php -v
PHP 8.1.4 (cli) (built: Apr 4 2022 13:30:17) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.4, Copyright (c) Zend Technologies
with Zend OPcache v8.1.4, Copyright (c), by Zend Technologies
with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans
框架: Laravel Framework 9.8.1
这是虚拟测试来源:
namespace Tests\Unit\Http\Controllers;
use App\Http\Controllers\TestController;
use Codeception\Test\Unit;
class TestController_Test extends Unit {
private static $O;
public function _before()
{
self::$O = new TestController();
}
/**
* @covers \TestController::__construct
*/
public function testIndex()
{
// Dummy...
$this->assertNotEmpty(self::$O->index());
}
}
我不知道为什么@coves根本不适合我。任何帮助将不胜感激。有没有类似问题的人?
我编辑了错字。 因此,@covers在我的测试中不起作用。 :(
I have problem with @covers annotation in tests (annotations like: @doesNotPerformAssertions works fine).
codeception.sh do nothing special... mostly just put test in sandbox.
PHP:
php -v
PHP 8.1.4 (cli) (built: Apr 4 2022 13:30:17) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.4, Copyright (c) Zend Technologies
with Zend OPcache v8.1.4, Copyright (c), by Zend Technologies
with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans
Framework:
Laravel Framework 9.8.1
Here is the dummy test source:
namespace Tests\Unit\Http\Controllers;
use App\Http\Controllers\TestController;
use Codeception\Test\Unit;
class TestController_Test extends Unit {
private static $O;
public function _before()
{
self::$O = new TestController();
}
/**
* @covers \TestController::__construct
*/
public function testIndex()
{
// Dummy...
$this->assertNotEmpty(self::$O->index());
}
}
I have no idea why @coves not works for me at all. Any help would be appreciated. Is there anyone who had similar problem?
I edited typo.
So, @covers not work in my tests. :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论