25 lines
658 B
PHP
25 lines
658 B
PHP
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use Illuminate\Contracts\Console\Kernel;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
|
|
|
abstract class TestCase extends BaseTestCase
|
|
{
|
|
/**
|
|
* L'applicazione si costruisce dallo stesso bootstrap/app.php che usa il
|
|
* runtime: middleware, provider e rotte sono quelli veri, cosi' un test non
|
|
* puo' passare grazie a una configurazione che esiste solo nei test.
|
|
*/
|
|
public function createApplication(): Application
|
|
{
|
|
$app = require __DIR__ . '/../bootstrap/app.php';
|
|
|
|
$app->make(Kernel::class)->bootstrap();
|
|
|
|
return $app;
|
|
}
|
|
}
|