false]); assert(is_array($phpunitArgv)); /** * We need to instantiate the Pest Test suite instance * so that Pest is able to execute correctly. */ $argv = new ArgvInput(); $rootPath = dirname(PHPUNIT_COMPOSER_INSTALL, 2); TestSuite::getInstance( $rootPath, $argv->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()), ); $application = new ApplicationForWrapperWorker( $phpunitArgv, $getopt['progress-file'], $getopt['testresult-file'], $getopt['teamcity-file'] ?? null, $getopt['testdox-file'] ?? null, isset($getopt['testdox-color']), ); while (true) { if (feof(STDIN)) { $application->end(); exit; } $testPath = fgets(STDIN); if ($testPath === false || $testPath === WrapperWorker::COMMAND_EXIT) { $application->end(); exit; } // It must be a 1 byte string to ensure filesize() is equal to the number of tests executed $exitCode = $application->runTest(trim($testPath)); fwrite($statusFile, (string) $exitCode); fflush($statusFile); } })();