/** * @test */ public function requestAuthenticationCode_requestAuthenticationCode_returnResponse() { $token = $this->getToken(); $context = $this->getAuthenticationContext($token, true); //Stub the SessionFlagManager $this->stubIsNotAuthenticated(true); //Stub the provider $this->provider->expects($this->any())->method('requestAuthenticationCode')->willReturn(new Response('<form></form>')); $returnValue = $this->registry->requestAuthenticationCode($context); $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $returnValue); $this->assertEquals('<form></form>', $returnValue->getContent()); }