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
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

相关文章
|
Ubuntu Unix Linux
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
|
5月前
|
Python
ERROR: file or directory not found: xx.py
​ 1、问题出现原因 在vscode中已导入pytest框架,做自动化demo小测试,运行Python文件一直出现如题错误,截图如下: ERROR: file or directory not found: xx.py  2、解决办法 1)直接把该文件移到当前主目录下,放在PYTHON-STUDY下 2)VSCode中右键tuopan.py文件,选择[在集成终端中打开],或者通过CD命令进入到tuopan.py文件所在目录 然后输入以下命令即可: 注:上述命令不是换行,在d:/前有空格 ,第一行信息为python所在安装路径,空格后的换行为运行的python文件的所在路径  
71 0
|
8月前
成功解决Failed to execute stage ‘Setup validation’: Cannot locate gluster packages
成功解决Failed to execute stage ‘Setup validation’: Cannot locate gluster packages
|
11月前
|
Java Maven
Error running ‘ssm [clean]‘: No valid Maven installation found. Either set the home directory in the
Error running ‘ssm [clean]‘: No valid Maven installation found. Either set the home directory in the
|
JavaScript
The file is in the program because: Imported via xxx Root file specified for compilation Vetur(1261)
The file is in the program because: Imported via xxx Root file specified for compilation Vetur(1261)
123 0
The file is in the program because: Imported via xxx Root file specified for compilation Vetur(1261)
|
缓存 PHP
Composer报错: require(): Failed opening required ‘.../markbaker/matrix/.../functions/adjoint.php‘
Composer报错: require(): Failed opening required ‘.../markbaker/matrix/.../functions/adjoint.php‘
190 0
|
开发工具 git
Can‘t find third_party/gtest. Run git submodule update --init, or disable with CMake -DBUILD_TEST
Can‘t find third_party/gtest. Run git submodule update --init, or disable with CMake -DBUILD_TEST
101 0
phpunit: This test did not perform any assertions
phpunit: This test did not perform any assertions
That command depends on command in Target 'XXX': script phase “[CP] Copy Pods Resourc 报错解决方法
That command depends on command in Target 'XXX': script phase “[CP] Copy Pods Resourc 报错解决方法
147 0
|
Ruby
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.错误解决办法
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.错误解决办法
2500 0