diff --git a/tests/Feature/Controllers/CategoryControllerTest.php b/tests/Feature/Controllers/CategoryControllerTest.php index e8f7ccc705..ae0531d9e9 100644 --- a/tests/Feature/Controllers/CategoryControllerTest.php +++ b/tests/Feature/Controllers/CategoryControllerTest.php @@ -101,11 +101,12 @@ class CategoryControllerTest extends TestCase public function testIndex() { // mock stuff + $category = factory(Category::class)->make(); $repository = $this->mock(CategoryRepositoryInterface::class); $journalRepos = $this->mock(JournalRepositoryInterface::class); $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal); - $repository->shouldReceive('getCategories')->andReturn(new Collection); - $repository->shouldReceive('lastUseDate')->andReturn(new Carbon); + $repository->shouldReceive('getCategories')->andReturn(new Collection([$category]))->once(); + $repository->shouldReceive('lastUseDate')->andReturn(new Carbon)->once(); $this->be($this->user()); $response = $this->get(route('categories.index')); @@ -220,47 +221,6 @@ class CategoryControllerTest extends TestCase $response->assertSee('