tests(integration): fix database services

This commit is contained in:
Matthew Penner 2021-03-05 09:15:23 -07:00
parent ffdf27e606
commit 350ef1aba5
3 changed files with 15 additions and 16 deletions

View file

@ -64,8 +64,8 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase
{
$server = $this->createServerModel();
$node = Node::factory()->create(['location_id' => $server->location->id]);
DatabaseHost::factory()->create(['node_id' => $node->id]);
$host = DatabaseHost::factory()->create();
$node = Node::factory()->create(['location_id' => $server->location->id, 'database_host_id' => $host->id]);
config()->set('pterodactyl.client_features.databases.allow_random', false);
@ -99,9 +99,9 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase
{
$server = $this->createServerModel();
$node = Node::factory()->create(['location_id' => $server->location->id]);
DatabaseHost::factory()->create(['node_id' => $node->id]);
$host = DatabaseHost::factory()->create(['node_id' => $server->node_id]);
$node = Node::factory()->create(['location_id' => $server->location->id, 'database_host_id' => DatabaseHost::factory()->create()->id]);
$host = DatabaseHost::factory()->create();
$server->node->database_host_id = $host->id;
$this->managementService->expects('create')->with($server, [
'database_host_id' => $host->id,
@ -126,8 +126,8 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase
{
$server = $this->createServerModel();
$node = Node::factory()->create(['location_id' => $server->location->id]);
$host = DatabaseHost::factory()->create(['node_id' => $node->id]);
$host = DatabaseHost::factory()->create();
$node = Node::factory()->create(['location_id' => $server->location->id, 'database_host_id' => $host->id]);
$this->managementService->expects('create')->with($server, [
'database_host_id' => $host->id,