0
点赞
收藏
分享

微信扫一扫

phpunit: This test did not perform any assertions

最不爱吃鱼 2022-02-12 阅读 162
php


phpunit 没有使用断言语句测试不通过,

This test did not perform any assertions

如果仅仅想执行单个函数,不想加断言,可以使用注解

<?php

declare(strict_types=1);

use PHPUnit\Framework\TestCase;

class TokenServiceTest extends TestCase
{
/**
* @doesNotPerformAssertions
*/
public function testGetToken(){
echo 'hello';
}
}


参考
PHPUnit passing a test with no assertions within config




举报

相关推荐

0 条评论