with('index')->once()->andReturn(\Mockery::self()) ->shouldReceive('with')->once() // Pass a 'with' parameter ->with('count', 0); Auth::shouldReceive('check')->andReturn(true); // mock account repository $accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); $accounts->shouldReceive('count')->andReturn(0); // call $this->call('GET', '/'); // test $this->assertResponseOk(); } public function tearDown() { Mockery::close(); } }