/** * Recursively attach dependencies of a testcases * * @param TestSuite $testSuite Target test suite to populate * @param Array $dependencies Array of testcase dependencies to attach * @param String $entryPoint Name of the testCase originating the dependency * * @return Void */ function attachDependencies($testSuite, $dependencies, $entryPoint) { foreach ($dependencies as $dependency) { if (!$testSuite->isAttached(substr($dependency, 0, -3))) { if (strcmp($entryPoint, $dependency) !== 0) { $this->populateTestSuite($testSuite, array($dependency), true); $this->info[] = 'Testcase "' . $dependency . '" were added as dependency of "' . $entryPoint . '"'; } else { throw new OutOfRangeException('An error occured while applying dependencies: Test cases "' . $entryPoint . '" and "' . $dependency . '" dependencies may lead to a deadlock situation.'); } } } }