|
From: SourceForge.net <no...@so...> - 2011-11-30 18:30:35
|
Bugs item #3373975, was opened at 2011-07-21 08:42 Message generated for change (Comment added) made by pp11 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=547455&aid=3373975&group_id=76550 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Unit test framework Group: None >Status: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: John Elliot (jselliot) >Assigned to: Perrick Penet (pp11) Summary: class TestGetClass extends UnitTestCase fails Initial Comment: Using SimpleTest v1.1alpha3. The following error is produced by the following code: Fatal error: Call to a member function getDumper() on a non-object in ...\simpletest\test_case.php on line 316 <?php error_reporting( E_ALL ); ini_set( 'display_errors', 'On' ); require_once( dirname( __FILE__ ) . '/../lib/simpletest/autorun.php' ); class TestGetClass extends UnitTestCase { public function testGetClass() { $this->assertTrue( true ); } } ?> The resolution is to rename the test case from "class TestGetClass" to "class Test_GetClass". I searched the simple test source code for 'GetClass' and found no references, so I'm stumped as to why the class name causes the test to fail like that. I had a TestGetClass unit-test because I was experimenting with uses of the PHP get_class function. ---------------------------------------------------------------------- >Comment By: Perrick Penet (pp11) Date: 2011-11-30 10:30 Message: The trouble starts when you call the "testGetClass" function : PHP thinks it's the constructor and SimpleTest thinks it's a test function. From then on everything gets confused ;-) Depending on what you really wanted to do you should either do : class TestGetClass extends UnitTestCase { public function __construct() { $this->assertTrue( true ); } } or class TestGetClass extends UnitTestCase { public function test_GetClass() { $this->assertTrue( true ); } } I hope you'll find this useful. Yours, Perrick ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=547455&aid=3373975&group_id=76550 |