示例#1
0
        continue;
    }
    if (!fnmatch('*Test.php', $objFile->getFilename())) {
        continue;
    }
    $strTestFile = $objFile->getPathname();
    # avoid test-case detection for already known files
    if (isset($arrTestCases[$strTestFile])) {
        continue;
    } else {
        $arrTestCases[$strTestFile] = array();
    }
    # get closure which will detect test-cases within the given file
    $cloGetTestCases = getTestCaseClosure($strTestFile, $arrDefinedFunctions, $intParentPID);
    # add closure to forking-queue and try to fork a new process if possible
    $objFork->addToQueue($cloGetTestCases);
    $objFork->fork();
    # get found testcases from queue; otherwise the queue will become full
    $cloGetCasesFromQueue();
}
# get the test-cases from all files stored in the queue
while (!$objFork->isQueueEmpty()) {
    $objFork->fork();
    $cloGetCasesFromQueue();
}
# wait until all test-cases received
$objFork->waitUntilForksFinished(100, $cloGetCasesFromQueue);
################################################
# execute all test-cases and get their results #
################################################
$arrTestResults = array();