phpunit: This test did not perform any assertions

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

This test did not perform any assertions

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

<?php


use PHPUnit\Framework\TestCase;

class Test extends TestCase
{
    /**
     * @doesNotPerformAssertions
     */
    public function testDefault(){
        echo 'empty:' . empty(0);
    }
}

参考
PHPUnit passing a test with no assertions within config

posted @ 2021-11-26 15:20  浅笑19  阅读(163)  评论(0)    收藏  举报