Merge branch 'config_caching_v2' of https://github.com/timacdonald/laravel into timacdonald-config_caching_v2

This commit is contained in:
Taylor Otwell 2019-07-30 16:36:53 -05:00
commit e21657dc5a
2 changed files with 36 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false" <phpunit backupGlobals="false"
backupStaticAttributes="false" backupStaticAttributes="false"
bootstrap="vendor/autoload.php" bootstrap="tests/bootstrap.php"
colors="true" colors="true"
convertErrorsToExceptions="true" convertErrorsToExceptions="true"
convertNoticesToExceptions="true" convertNoticesToExceptions="true"
@ -29,5 +29,10 @@
<server name="MAIL_DRIVER" value="array"/> <server name="MAIL_DRIVER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/> <server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/> <server name="SESSION_DRIVER" value="array"/>
<server name="APP_CONFIG_CACHE" value="bootstrap/cache/config.phpunit.php"/>
<server name="APP_SERVICES_CACHE" value="bootstrap/cache/services.phpunit.php"/>
<server name="APP_PACKAGES_CACHE" value="bootstrap/cache/packages.phpunit.php"/>
<server name="APP_ROUTES_CACHE" value="bootstrap/cache/routes.phpunit.php"/>
<server name="APP_EVENTS_CACHE" value="bootstrap/cache/events.phpunit.php"/>
</php> </php>
</phpunit> </phpunit>

30
tests/bootstrap.php Normal file
View File

@ -0,0 +1,30 @@
<?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);
}