@@ -2,11 +2,30 @@
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabaseState;
|
||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||
use Laravel\Fortify\Features;
|
||||
|
||||
abstract class TestCase extends BaseTestCase
|
||||
{
|
||||
public function createApplication(): Application
|
||||
{
|
||||
$app = parent::createApplication();
|
||||
// migrate:fresh only clears the connection's public search path. This module owns a separate schema.
|
||||
if (! RefreshDatabaseState::$migrated && $app->environment('testing')) {
|
||||
$db = $app->make('db')->connection();
|
||||
if ($db->getDriverName() === 'pgsql'
|
||||
&& in_array($db->getDatabaseName(), ['portal_services_test', 'investmoz_test'], true)
|
||||
&& (string) $db->getConfig('port') === '55441'
|
||||
&& in_array($db->getConfig('host'), ['127.0.0.1', 'localhost'], true)) {
|
||||
$db->statement('DROP SCHEMA IF EXISTS skills_edu CASCADE');
|
||||
}
|
||||
}
|
||||
|
||||
return $app;
|
||||
}
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
Reference in New Issue
Block a user