misc_pterodactyl-panel/tests/Traits/DatabaseMigrations.php

26 lines
593 B
PHP
Raw Normal View History

2022-10-27 01:04:32 +00:00
<?php
namespace Pterodactyl\Tests\Traits;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Foundation\Testing\Traits\CanConfigureMigrationCommands;
use Illuminate\Foundation\Testing\DatabaseMigrations as DM;
2022-10-27 01:04:32 +00:00
trait DatabaseMigrations
{
use CanConfigureMigrationCommands;
use DM;
2022-10-27 01:04:32 +00:00
/**
* Define hooks to migrate the database before and after each test.
*
* @return void
2022-10-27 01:04:32 +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);
}
}