/** * Creates an instance from a testcase * * @param unittest.TestCase $instance * @throws lang.IllegalStateException for overriding test class methods with tests * @throws lang.MethodNotImplementedException in case given argument is not a valid testcase */ public function __construct($instance) { $class = $instance->getClass(); if (!$class->hasMethod($instance->name)) { throw new MethodNotImplementedException('Test method does not exist', $instance->name); } if (self::$base->hasMethod($instance->name)) { throw $this->cannotOverride($class->getMethod($instance->name)); } $this->instance = $instance; }
/** * Calculate index * * @param unittest.TestCase $test * @return string */ protected function index($test) { return $test->getName(); }