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