PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Testing » PHPUnit2 » Bug #2403

invoke() in BaseTestRunner.php must have at least one parameter

Details

Submitted2004-09-27 07:26 UTC
Fromyves dot bolognini at camptocamp dot com
StatusClosed
PackagePHPUnit2
PHP Version5.0.1
OSDebian
Roadmaps(Not assigned)

Comments

[2004-09-27 07:26 UTC] yves dot bolognini at camptocamp dot com

Description:
------------
I am using PHPUnit2 version 2.0.2 on PHP 5.0.1/Debian.

When calling directly a TestSuite with static method suite(), I get the following error :

<b>Warning</b>: invoke expects at least one parameter, none given in <b>/home/yves/eclipse/workspace/my_ws/include/pear/PHPUnit2/Runner/BaseTestRunner.php</b> on line <b>141</b><br />
<br />
<b>Fatal error</b>: Argument 1 must be an object of class PHPUnit2_Framework_Test in <b>/home/yves/eclipse/workspace/my_ws/include/pear/PHPUnit2/TextUI/TestRunner.php</b> on line <b>202</b><br />

It seems that the invoke method in BaseTestRunner.php (line 141) does not have any parameters. According to the documentation, invoking a static method requires at least one parameter, which can be 'NULL'.

Reproduce code:
---------------
<?php

require_once 'PHPUnit2/Framework/TestSuite.php';
require_once 'Test1Test.php';
require_once 'Test2Test.php';

class tests_client_AllTests {

public static function suite() {
$suite = new PHPUnit2_Framework_TestSuite;
$suite->addTestSuite('tests_test1_Test1Test');
$suite->addTestSuite('tests_test2_Test2Test');
return $suite;
}

}

?>

Expected result:
----------------
No error while calling the suite using the TestRunner.php.

Actual result:
--------------
<b>Warning</b>: invoke expects at least one parameter, none given in <b>/home/yves/eclipse/workspace/my_ws/include/pear/PHPUnit2/Runner/BaseTestRunner.php</b> on line <b>141</b><br />