2022-10-27 01:04:32 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Tests\Traits;
|
|
|
|
|
|
|
|
use Illuminate\Contracts\Console\Kernel;
|
|
|
|
use Illuminate\Foundation\Testing\Traits\CanConfigureMigrationCommands;
|
2022-10-28 01:46:14 +00:00
|
|
|
use Illuminate\Foundation\Testing\DatabaseMigrations as DM;
|
2022-10-27 01:04:32 +00:00
|
|
|
|
|
|
|
trait DatabaseMigrations
|
|
|
|
{
|
|
|
|
use CanConfigureMigrationCommands;
|
2022-10-28 01:46:14 +00:00
|
|
|
use DM;
|
2022-10-27 01:04:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Define hooks to migrate the database before and after each test.
|
|
|
|
*
|
2022-10-28 01:46:14 +00:00
|
|
|
* @return void
|
2022-10-27 01:04:32 +00:00
|
|
|
*/
|
2022-10-28 01:46:14 +00:00
|
|
|
public function runDatabaseMigrations()
|
2022-10-27 01:04:32 +00:00
|
|
|
{
|
|
|
|
$this->artisan('migrate:fresh', $this->migrateFreshUsing());
|
|
|
|
|
|
|
|
$this->app[Kernel::class]->setArtisan(null);
|
|
|
|
}
|
|
|
|
}
|