Finish up unit tests for base controllers
This commit is contained in:
parent
4203cdcb77
commit
37508a370d
7 changed files with 507 additions and 40 deletions
|
@ -90,13 +90,14 @@ class DatabaseControllerTest extends TestCase
|
|||
$this->locationRepository->shouldReceive('getAllWithNodes')->withNoArgs()->once()->andReturn('getAllWithNodes');
|
||||
$this->repository->shouldReceive('getWithViewDetails')->withNoArgs()->once()->andReturn('getWithViewDetails');
|
||||
|
||||
$view = $this->controller->index();
|
||||
$response = $this->controller->index();
|
||||
|
||||
$this->assertViewNameEquals('admin.databases.index', $view);
|
||||
$this->assertViewHasKey('locations', $view);
|
||||
$this->assertViewHasKey('hosts', $view);
|
||||
$this->assertViewKeyEquals('locations', 'getAllWithNodes', $view);
|
||||
$this->assertViewKeyEquals('hosts', 'getWithViewDetails', $view);
|
||||
$this->assertIsViewResponse($response);
|
||||
$this->assertViewNameEquals('admin.databases.index', $response);
|
||||
$this->assertViewHasKey('locations', $response);
|
||||
$this->assertViewHasKey('hosts', $response);
|
||||
$this->assertViewKeyEquals('locations', 'getAllWithNodes', $response);
|
||||
$this->assertViewKeyEquals('hosts', 'getWithViewDetails', $response);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -107,12 +108,13 @@ class DatabaseControllerTest extends TestCase
|
|||
$this->locationRepository->shouldReceive('getAllWithNodes')->withNoArgs()->once()->andReturn('getAllWithNodes');
|
||||
$this->repository->shouldReceive('getWithServers')->with(1)->once()->andReturn('getWithServers');
|
||||
|
||||
$view = $this->controller->view(1);
|
||||
$response = $this->controller->view(1);
|
||||
|
||||
$this->assertViewNameEquals('admin.databases.view', $view);
|
||||
$this->assertViewHasKey('locations', $view);
|
||||
$this->assertViewHasKey('host', $view);
|
||||
$this->assertViewKeyEquals('locations', 'getAllWithNodes', $view);
|
||||
$this->assertViewKeyEquals('host', 'getWithServers', $view);
|
||||
$this->assertIsViewResponse($response);
|
||||
$this->assertViewNameEquals('admin.databases.view', $response);
|
||||
$this->assertViewHasKey('locations', $response);
|
||||
$this->assertViewHasKey('host', $response);
|
||||
$this->assertViewKeyEquals('locations', 'getAllWithNodes', $response);
|
||||
$this->assertViewKeyEquals('host', 'getWithServers', $response);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue