public function testAddCaptcha() { $app = new Application(Application::ENV_TEST); $app['conf'] = $this->getMockBuilder('Alchemy\\Phrasea\\Core\\Configuration\\PropertyAccess')->disableOriginalConstructor()->getMock(); $app['conf']->expects($this->any())->method('get')->with(['registry', 'webservices', 'captcha-enabled'])->will($this->returnValue(true)); $this->assertFalse($app->isCaptchaRequired()); $app->requireCaptcha(); $this->assertTrue($app->isCaptchaRequired()); $this->assertFalse($app->isCaptchaRequired()); }