mock(HelpInterface::class); $help->shouldReceive('hasRoute')->andReturn(true)->once(); $help->shouldReceive('inCache')->andReturn(false)->once(); $help->shouldReceive('getFromGithub')->andReturn('Help content here.')->once(); $help->shouldReceive('putInCache')->once(); $this->be($this->user()); $response = $this->get(route('help.show', ['index'])); $response->assertStatus(200); } }