public function testCreateGoogleDriver() { list($app, $config) = $this->getMocks(); $instance = new CaptchaManager($app); $mockReq = m::mock('Illuminate\\Http\\Request'); $mockFE = m::mock('Xpressengine\\Presenter\\Html\\FrontendHandler'); $app->shouldReceive('offsetGet')->with('config')->andReturn($config); $app->shouldReceive('offsetGet')->with('request')->andReturn($mockReq); $app->shouldReceive('offsetGet')->with('xe.frontend')->andReturn($mockFE); $driver = $instance->createGoogleDriver(); $this->assertInstanceOf('Xpressengine\\Captcha\\GoogleRecaptcha', $driver); }