Update to Laravel 8
Co-authored-by: Matthew Penner <me@matthewp.io>
This commit is contained in:
parent
028921b42a
commit
a043071e3c
211 changed files with 4394 additions and 2933 deletions
|
@ -36,7 +36,7 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
|||
$server2 = $this->createServerModel();
|
||||
|
||||
/** @var \Pterodactyl\Models\Allocation[] $allocations */
|
||||
$allocations = factory(Allocation::class)->times(4)->create(['node_id' => $server->node_id, 'notes' => 'Random notes']);
|
||||
$allocations = Allocation::factory()->times(4)->create(['node_id' => $server->node_id, 'notes' => 'Random notes']);
|
||||
|
||||
$initialAllocationId = $server->allocation_id;
|
||||
$allocations[0]->update(['server_id' => $server->id, 'notes' => 'Test notes']);
|
||||
|
@ -83,7 +83,7 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
|||
{
|
||||
$server = $this->createServerModel();
|
||||
/** @var \Pterodactyl\Models\Allocation[] $allocations */
|
||||
$allocations = factory(Allocation::class)->times(4)->create(['node_id' => $server->node_id]);
|
||||
$allocations = Allocation::factory()->times(4)->create(['node_id' => $server->node_id]);
|
||||
|
||||
$allocations[0]->update(['server_id' => $server->id]);
|
||||
|
||||
|
@ -155,8 +155,8 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
|||
public function testNoExceptionIsThrownIfOnlyRemovingAllocation()
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
/** @var \Pterodactyl\Models\Allocation[] $allocations */
|
||||
$allocation = factory(Allocation::class)->create(['node_id' => $server->node_id, 'server_id' => $server->id]);
|
||||
/** @var \Pterodactyl\Models\Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $server->node_id, 'server_id' => $server->id]);
|
||||
|
||||
$this->daemonServerRepository->expects('setServer->update')->andReturnUndefined();
|
||||
|
||||
|
@ -178,8 +178,8 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
|||
public function testAllocationInBothAddAndRemoveIsAdded()
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
/** @var \Pterodactyl\Models\Allocation[] $allocations */
|
||||
$allocation = factory(Allocation::class)->create(['node_id' => $server->node_id]);
|
||||
/** @var \Pterodactyl\Models\Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $server->node_id]);
|
||||
|
||||
$this->daemonServerRepository->expects('setServer->update')->andReturnUndefined();
|
||||
|
||||
|
@ -197,9 +197,10 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
|||
public function testUsingSameAllocationIdMultipleTimesDoesNotError()
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
/** @var \Pterodactyl\Models\Allocation[] $allocations */
|
||||
$allocation = factory(Allocation::class)->create(['node_id' => $server->node_id, 'server_id' => $server->id]);
|
||||
$allocation2 = factory(Allocation::class)->create(['node_id' => $server->node_id]);
|
||||
/** @var \Pterodactyl\Models\Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $server->node_id, 'server_id' => $server->id]);
|
||||
/** @var \Pterodactyl\Models\Allocation $allocation2 */
|
||||
$allocation2 = Allocation::factory()->create(['node_id' => $server->node_id]);
|
||||
|
||||
$this->daemonServerRepository->expects('setServer->update')->andReturnUndefined();
|
||||
|
||||
|
@ -219,8 +220,8 @@ class BuildModificationServiceTest extends IntegrationTestCase
|
|||
public function testThatUpdatesAreRolledBackIfExceptionIsEncountered()
|
||||
{
|
||||
$server = $this->createServerModel();
|
||||
/** @var \Pterodactyl\Models\Allocation[] $allocations */
|
||||
$allocation = factory(Allocation::class)->create(['node_id' => $server->node_id]);
|
||||
/** @var \Pterodactyl\Models\Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $server->node_id]);
|
||||
|
||||
$this->daemonServerRepository->expects('setServer->update')->andThrows(new DisplayException('Test'));
|
||||
|
||||
|
|
Reference in a new issue