protected function createTestFromCestMethod($cestInstance, $methodName, $file) { if (strpos($methodName, '_') === 0 or $methodName == '__construct') { return null; } $testClass = get_class($cestInstance); $cest = new Cest(); $cest->configName($methodName)->configFile($file)->config('testClassInstance', $cestInstance)->config('testMethod', $methodName)->initConfig(); $cest->getScenario()->env(Annotation::forMethod($testClass, $methodName)->fetchAll('env')); $cest->setDependencies(\PHPUnit_Util_Test::getDependencies($testClass, $methodName)); return $cest; }
protected function createTestFromCestMethod($cestInstance, $methodName, $file) { $testClass = get_class($cestInstance); if (strpos($methodName, '_') === 0) { return; } $guy = $this->settings['namespace'] ? $this->settings['namespace'] . '\\Codeception\\' . $this->settings['class_name'] : $this->settings['class_name']; $target = $testClass . '::' . $methodName; $cest = new TestCase\Cest($this->dispatcher, array('name' => $target, 'instance' => $cestInstance, 'method' => $methodName, 'file' => $file, 'bootstrap' => $this->settings['bootstrap'], 'guy' => $guy)); $cest->setDependencies(\PHPUnit_Util_Test::getDependencies($testClass, $methodName)); $cest->preload(); return $cest; }
protected function createTestFromCestMethod($cestInstance, $methodName, $file) { if (strpos($methodName, '_') === 0 || $methodName == '__construct') { return null; } $testClass = get_class($cestInstance); $cest = new Cest(); $cest->configName($methodName)->configFile($file)->config('testClassInstance', $cestInstance)->config('testMethod', $methodName); $cest->setDependencies(\PHPUnit_Util_Test::getDependencies($testClass, $methodName)); return $cest; }
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; }