编程语言
首页 > 编程语言> > phpunit: This test did not perform any assertions

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

标签:did,perform,phpunit,test,any,assertions
来源: https://www.cnblogs.com/qianxiaoPro/p/15608033.html