Update repository base code to be cleaner and make use of PHP 7 features

This commit is contained in:
Dane Everitt 2018-01-04 22:49:50 -06:00
parent 0ec5a4e08c
commit 60eb60013c
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
96 changed files with 1048 additions and 1785 deletions

View file

@ -97,7 +97,7 @@ class DaemonKeyDeletionServiceTest extends TestCase
['server_id', '=', $server->id],
])->once()->andReturn($key);
$this->repository->shouldReceive('delete')->with($key->id)->once()->andReturnNull();
$this->repository->shouldReceive('delete')->with($key->id)->once()->andReturn(1);
$this->daemonRepository->shouldReceive('setNode')->with($server->node_id)->once()->andReturnSelf()
->shouldReceive('revokeAccessKey')->with($key->secret)->once()->andReturnNull();
$this->connection->shouldReceive('commit')->withNoArgs()->once()->andReturnNull();
@ -121,7 +121,7 @@ class DaemonKeyDeletionServiceTest extends TestCase
['server_id', '=', $server->id],
])->once()->andReturn($key);
$this->repository->shouldReceive('delete')->with($key->id)->once()->andReturnNull();
$this->repository->shouldReceive('delete')->with($key->id)->once()->andReturn(1);
$this->daemonRepository->shouldReceive('setNode')->with($server->node_id)->once()->andReturnSelf()
->shouldReceive('revokeAccessKey')->with($key->secret)->once()->andReturnNull();
$this->connection->shouldReceive('commit')->withNoArgs()->once()->andReturnNull();
@ -144,7 +144,7 @@ class DaemonKeyDeletionServiceTest extends TestCase
['server_id', '=', $server->id],
])->once()->andReturn($key);
$this->repository->shouldReceive('delete')->with($key->id)->once()->andReturnNull();
$this->repository->shouldReceive('delete')->with($key->id)->once()->andReturn(1);
$this->daemonRepository->shouldReceive('setNode')->with($server->node_id)->once()->andThrow($this->exception);
$this->exception->shouldReceive('getResponse')->withNoArgs()->once()->andReturnNull();
$this->connection->shouldReceive('rollBack')->withNoArgs()->once()->andReturnNull();