Expand test coverage.

This commit is contained in:
James Cole
2018-03-03 14:24:06 +01:00
parent 99d116f4ce
commit 9dc4c50527
17 changed files with 311 additions and 56 deletions

View File

@@ -139,8 +139,10 @@ class LinkControllerTest extends TestCase
*/
public function testIndex()
{
$linkTypes = LinkType::inRandomOrder()->take(3)->get();
$repository = $this->mock(LinkTypeRepositoryInterface::class);
$repository->shouldReceive('get')->andReturn(new Collection);
$repository->shouldReceive('get')->andReturn($linkTypes);
$repository->shouldReceive('countJournals')->andReturn(3);
$this->be($this->user());
$response = $this->get(route('admin.links.index'));
$response->assertStatus(200);