PHPUnit ReflectionException Method suite does not exist(PHPUnit ReflectionException 方法套件不存在)
问题描述
我使用的是 PHPUnit 3.6.2 版,并且总是得到
I'm using PHPUnit version 3.6.2, and always got
PHP ReflectionException:第 113 行的/pathTo/pear/PHPUnit/Runner/BaseTestRunner.php 中不存在方法套件
PHP ReflectionException: Method suite does not exist in /pathTo/pear/PHPUnit/Runner/BaseTestRunner.php on line 113
运行单个测试时:
phpunit path/to/my/ClassToTest.php
PHPUnit 使用 pear 安装,我使用的是 php 5.3.6
PHPUnit installed using pear, and I'm using php 5.3.6
我应该修复任何 php 配置吗?或者这只是 PHPUnit 应该解决的问题.
are there any php configurations i should fix? or this just something that PHPUnit should fix.
班级
<?php
class ClassToTest extends PHPUnit_Framework_TestCase{
public function testSomething(){
$this->assertTrue(true);
}
}
推荐答案
如果您使用 VS Code 并在尝试调试单元测试时遇到此异常,请确保 Everything 框没有签入 Breakpoints 窗格.取消选中该框让我摆脱了这个问题:
If you're using VS Code and getting this exception while trying to debug your unit tests, make sure the Everything box is not checked in Breakpoints pane. Unchecking that box got me rid of this issue:
这篇关于PHPUnit ReflectionException 方法套件不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHPUnit ReflectionException 方法套件不存在


基础教程推荐
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何替换eregi() 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01