From 731cd4c499638138c3331572f726310354d1b1ea Mon Sep 17 00:00:00 2001 From: Sjors Ottjes Date: Fri, 6 Sep 2019 08:16:34 +0200 Subject: [PATCH] add phpunit extension --- phpunit.xml | 5 ++++- tests/Bootstrap.php | 42 ++++++++++++++++++++++++++++++++++++++++++ tests/bootstrap.php | 33 --------------------------------- 3 files changed, 46 insertions(+), 34 deletions(-) create mode 100644 tests/Bootstrap.php delete mode 100644 tests/bootstrap.php diff --git a/phpunit.xml b/phpunit.xml index d562be80..61b6b64b 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,7 @@ ./app + + + diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php new file mode 100644 index 00000000..5fa7829c --- /dev/null +++ b/tests/Bootstrap.php @@ -0,0 +1,42 @@ +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')); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index 943a2898..00000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,33 +0,0 @@ -make(Kernel::class))->bootstrap(); - -foreach ($commands as $command) { - $console->call($command); -}