/** * @param Reflection_Class $theClass * @param string $name * @return PHPUnit_Framework_Test * @access public * @static */ public static function createTest(Reflection_Class $theClass, $name) { $test = $theClass->newInstance(); if ($test instanceof PHPUnit_Framework_TestCase) { $test->setName($name); } else { return self::warning(sprintf('Cannot instantiate test case: %s', $name)); } return $test; }
/** * Override to run the test and assert its state. * * @access protected */ protected function runTest() { self::assertNotNull($this->fName); try { $class = new Reflection_Class($this); $method = $class->getMethod($this->fName); } catch (Exception $e) { self::fail($e->getMessage()); } $method->invoke(new $class->name()); }