*/ private const NEEDED_FILES = [ 'composer.json', 'tests', ]; /** * Validates the environment. */ public static function in(TestSuite $testSuite): void { $rootPath = $testSuite->rootPath; $exists = function ($neededFile) use ($rootPath): bool { return file_exists(sprintf('%s%s%s', $rootPath, DIRECTORY_SEPARATOR, $neededFile)); }; foreach (self::NEEDED_FILES as $neededFile) { if (!$exists($neededFile)) { throw new FileOrFolderNotFound($neededFile); } } } }