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