Set up application testing bootstrap

This commit is contained in:
Arya Dwi Putra
2025-12-01 07:37:21 +07:00
parent 3c85d5eec1
commit 9af536a6be
2 changed files with 20 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
<?php
namespace Tests;
use Illuminate\Contracts\Console\Kernel;
trait CreatesApplication
{
/**
* Bootstrap aplikasi untuk kebutuhan pengujian.
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
return $app;
}
}

View File

@@ -6,5 +6,5 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
//
use CreatesApplication;
}