mock(GeneratorInterface::class); $repository = $this->mock(PiggyBankRepositoryInterface::class); $event = factory(PiggyBankEvent::class)->make(); $repository->shouldReceive('getEvents')->andReturn(new Collection([$event])); $generator->shouldReceive('singleSet')->once()->andReturn([]); $this->be($this->user()); $response = $this->get(route('chart.piggy-bank.history', [1])); $response->assertStatus(200); } }