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()); $this->call('GET', route('help.show', ['index'])); $this->assertResponseStatus(200); } }