Skip to content

Commit

Permalink
Use repository
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmlozano committed Jan 13, 2022
1 parent a3e749f commit cedefe3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Commands/Servers/RebootCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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());
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Commands/ServersRebootCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit cedefe3

Please sign in to comment.