10

I'm using PHPUnit version 3.6.2, and always got

PHP ReflectionException: Method suite does not exist in /pathTo/pear/PHPUnit/Runner/BaseTestRunner.php on line 113

when running single test:

phpunit path/to/my/ClassToTest.php

PHPUnit installed using pear, and I'm using php 5.3.6

are there any php configurations i should fix? or this just something that PHPUnit should fix.

the class

<?php

class ClassToTest extends PHPUnit_Framework_TestCase{

    public function testSomething(){
        $this->assertTrue(true);
    }

}
3
  • 2
    Show the code in ClassToTest.php. Commented Nov 29, 2011 at 3:23
  • 1
    Can't replicate this. How are you running the test? Commented Nov 29, 2011 at 3:51
  • phpunit path/to/my/ClassToTest.php Commented Nov 29, 2011 at 5:39

4 Answers 4

5

I stumbled upon the same message after enabling xdebug extension.

Try adding this in your php.ini (or comment the line with the 1 for this value) :

    ; 0 is actually the default value
    xdebug.show_exception_trace = 0
Sign up to request clarification or add additional context in comments.

Comments

5

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:

enter image description here

Comments

2

To understand why "show_exception_trace=1" causes this problem, see: Why does PHPUnit hide my xdebug backtrace?

Comments

-2

xdebug.show_exception_trace = 0 works !

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.