diff --git a/app/Commands/Servers/RebootCommand.php b/app/Commands/Servers/RebootCommand.php index 5f9d9a1..ba0d9ea 100644 --- a/app/Commands/Servers/RebootCommand.php +++ b/app/Commands/Servers/RebootCommand.php @@ -27,7 +27,7 @@ public function action(): int $serverId = $this->askToSelectServer('Which server would you like to reboot'); } - $server = $this->spinupwp->servers->get((int) $serverId); + $server = $this->spinupwp->getServer((int) $serverId); if ((bool) $this->option('force') || $this->confirm("Are you sure you want to reboot \"{$server->name}\"?", true)) { $this->rebootServers([$server]); @@ -39,7 +39,7 @@ public function action(): int protected function rebootAll(): void { if ((bool) $this->option('force') || $this->confirm('Are you sure you want to reboot all servers?', true)) { - $this->rebootServers($this->spinupwp->servers->list()->toArray()); + $this->rebootServers($this->spinupwp->listServers()->toArray()); } } diff --git a/tests/Feature/Commands/ServersRebootCommandTest.php b/tests/Feature/Commands/ServersRebootCommandTest.php index 20c6ece..aad4029 100644 --- a/tests/Feature/Commands/ServersRebootCommandTest.php +++ b/tests/Feature/Commands/ServersRebootCommandTest.php @@ -30,7 +30,7 @@ }); test('reboot all servers', function () { - $this->clientMock->shouldReceive('request')->once()->with('GET', 'servers?page=1', [])->andReturn( + $this->clientMock->shouldReceive('request')->once()->with('GET', 'servers?page=1&limit=100', [])->andReturn( new Response(200, [], listResponseJson([ ['id' => 1, 'name' => 'hellfish-media'], ['id' => 2, 'name' => 'staging.hellfish-media'],