introduce test bootstrapping

This commit is contained in:
Tim MacDonald
2019-07-05 14:20:33 +10:00
parent ebc6f6e2c7
commit 56960ed2a0
2 changed files with 37 additions and 1 deletions

31
tests/bootstrap.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Contracts\Console\Kernel;
require_once __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Bootstrap the testing environment
|--------------------------------------------------------------------------
|
| You have the option to specify console commands that will execute before your
| test suite is run. Caching config, routes, & events may improve performance
| and bring your testing environment closer to production.
|
*/
$commands = [
'config:cache',
'event:cache',
// 'route:cache',
];
$app = require __DIR__.'/../bootstrap/app.php';
$console = tap($app->make(Kernel::class))->bootstrap();
foreach ($commands as $command) {
$console->call($command);
}