misc_pterodactyl-panel/bootstrap/tests.php

29 lines
793 B
PHP
Raw Normal View History

2018-03-04 22:30:16 +00:00
<?php
use Illuminate\Contracts\Console\Kernel;
use Symfony\Component\Console\Output\ConsoleOutput;
2018-03-22 03:28:01 +00:00
require __DIR__ . '/../vendor/autoload.php';
2018-03-04 22:30:16 +00:00
$app = require __DIR__ . '/app.php';
/** @var \Pterodactyl\Console\Kernel $kernel */
$kernel = $app->make(Kernel::class);
2018-04-08 20:37:27 +00:00
/*
2018-03-04 22:30:16 +00:00
* Bootstrap the kernel and prepare application for testing.
*/
$kernel->bootstrap();
$output = new ConsoleOutput;
2018-04-08 20:37:27 +00:00
/*
2018-03-04 22:30:16 +00:00
* Perform database migrations and reseeding before continuing with
* running the tests.
*/
$output->writeln(PHP_EOL . '<comment>Refreshing database for Integration tests...</comment>');
$kernel->call('migrate:fresh', ['--database' => 'testing']);
$output->writeln('<comment>Seeding database for Integration tests...</comment>' . PHP_EOL);
$kernel->call('db:seed', ['--database' => 'testing']);