mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 05:43:45 +02:00
Update repository base code to be cleaner and make use of PHP 7 features
This commit is contained in:
@@ -103,7 +103,7 @@ class FileActionsControllerTest extends ControllerTestCase
|
||||
->shouldReceive('setAccessToken')->with('abc123')->once()->andReturnSelf()
|
||||
->shouldReceive('getContent')->with($file)->once()->andReturn('file contents');
|
||||
|
||||
$response = $controller->update($this->request, '1234', $file);
|
||||
$response = $controller->view($this->request, '1234', $file);
|
||||
$this->assertIsViewResponse($response);
|
||||
$this->assertViewNameEquals('server.files.edit', $response);
|
||||
$this->assertViewHasKey('file', $response);
|
||||
@@ -134,7 +134,7 @@ class FileActionsControllerTest extends ControllerTestCase
|
||||
$this->repository->shouldReceive('setNode')->with($server->node_id)->once()->andThrow($this->getExceptionMock());
|
||||
|
||||
try {
|
||||
$controller->update($this->request, '1234', 'file.txt');
|
||||
$controller->view($this->request, '1234', 'file.txt');
|
||||
} catch (PterodactylException $exception) {
|
||||
$this->assertInstanceOf(DaemonConnectionException::class, $exception);
|
||||
$this->assertInstanceOf(RequestException::class, $exception->getPrevious());
|
||||
|
||||
@@ -76,7 +76,7 @@ class SubuserControllerTest extends ControllerTestCase
|
||||
$this->mockInjectJavascript();
|
||||
|
||||
$controller->shouldReceive('authorize')->with('list-subusers', $server)->once()->andReturnNull();
|
||||
$this->repository->shouldReceive('findWhere')->with([['server_id', '=', $server->id]])->once()->andReturn([]);
|
||||
$this->repository->shouldReceive('findWhere')->with([['server_id', '=', $server->id]])->once()->andReturn(collect());
|
||||
|
||||
$response = $controller->index($this->request);
|
||||
$this->assertIsViewResponse($response);
|
||||
|
||||
Reference in New Issue
Block a user