23 lines
507 B
PHP
23 lines
507 B
PHP
|
<?php
|
||
|
|
||
|
namespace Pterodactyl\Tests\Traits;
|
||
|
|
||
|
use Illuminate\Contracts\Console\Kernel;
|
||
|
use Illuminate\Foundation\Testing\Traits\CanConfigureMigrationCommands;
|
||
|
|
||
|
trait DatabaseMigrations
|
||
|
{
|
||
|
use CanConfigureMigrationCommands;
|
||
|
|
||
|
/**
|
||
|
* Define hooks to migrate the database before and after each test.
|
||
|
*
|
||
|
*/
|
||
|
public function runDatabaseMigrations(): void
|
||
|
{
|
||
|
$this->artisan('migrate:fresh', $this->migrateFreshUsing());
|
||
|
|
||
|
$this->app[Kernel::class]->setArtisan(null);
|
||
|
}
|
||
|
}
|