protected function executeAfter($testMethod, $I) { $after = Annotation::forClass($this->testClassInstance)->method($testMethod)->fetch('after'); if (!$after) { return; } $this->executeContextMethod($after, $I); }
public function testMultipleMethodAnnotations() { $this->assertEquals(array('$var1', '$var2'), Annotation::forClass(__CLASS__)->method('testMethodAnnotation')->fetchAll('param')); }
public function configActor($actor) { foreach (['actor', 'guy'] as $annotation) { $definedActor = Annotation::forMethod($this->testClassInstance, $this->testMethod)->fetch($annotation); if (!$definedActor) { $definedActor = Annotation::forClass($this->testClassInstance)->fetch($annotation); } if ($definedActor) { $this->actor = $definedActor; return $this; } } $this->actor = $actor; return $this; }
protected function createTestFromCestMethod($cestInstance, $methodName, $file, $guy) { $testClass = get_class($cestInstance); if (strpos($methodName, '_') === 0) { return; } $overriddenGuy = Annotation::forMethod($testClass, $methodName)->fetch('guy'); if (!$overriddenGuy) { $overriddenGuy = Annotation::forClass($testClass)->fetch('guy'); } if ($overriddenGuy) { $guy = $overriddenGuy; } $cest = new TestCase\Cest($this->dispatcher, array('name' => $methodName, 'instance' => $cestInstance, 'method' => $methodName, 'file' => $file, 'bootstrap' => $this->settings['bootstrap'], 'guy' => $guy)); $cest->getScenario()->env(Annotation::forMethod($testClass, $methodName)->fetchAll('env')); $cest->getScenario()->groups(\PHPUnit_Util_Test::getGroups($testClass, $methodName)); $cest->setDependencies(\PHPUnit_Util_Test::getDependencies($testClass, $methodName)); $cest->preload(); return $cest; }