123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace Tests;
- use Illuminate\Contracts\Console\Kernel;
- use PHPUnit\Runner\AfterLastTestHook;
- use PHPUnit\Runner\BeforeFirstTestHook;
- class Bootstrap implements BeforeFirstTestHook, AfterLastTestHook
- {
-
- use CreatesApplication;
- public function executeBeforeFirstTest(): void
- {
- $console = $this->createApplication()->make(Kernel::class);
- $commands = [
- 'config:cache',
- 'event:cache',
- ];
- foreach ($commands as $command) {
- $console->call($command);
- }
- }
- public function executeAfterLastTest(): void
- {
- array_map('unlink', glob('bootstrap/cache/*.phpunit.php'));
- }
- }
|