isLumen() ? 'stubs/Lumen' : 'stubs/Laravel'; foreach ([$pest, $helpers] as $file) { if (File::exists($file)) { throw new InvalidConsoleArgument(sprintf('%s already exist', $file)); } } File::copy(implode(DIRECTORY_SEPARATOR, [ dirname(__DIR__, 3), $stubs, 'Pest.php', ]), $pest); File::copy(implode(DIRECTORY_SEPARATOR, [ dirname(__DIR__, 3), $stubs, 'Helpers.php', ]), $helpers); $this->output->success('`tests/Pest.php` created successfully.'); $this->output->success('`tests/Helpers.php` created successfully.'); if (!(bool) $this->option('no-interaction')) { (new Thanks($this->output))(); } } /** * Determine if this is a Lumen application. */ private function isLumen(): bool { /* @phpstan-ignore-next-line */ return Str::startsWith(app()->version(), 'Lumen'); } }