PHPUnit ReflectionException 方法套件不存在 [英] PHPUnit ReflectionException Method suite does not exist

查看:28
本文介绍了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 方法套件不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆