Scheb\TwoFactorBundle\Tests\Security\TwoFactor\Provider\Google\TwoFactorProviderTest::requestAuthenticationCode_invalidCode_displayFlashMessage PHP Method

requestAuthenticationCode_invalidCode_displayFlashMessage() public method

    public function requestAuthenticationCode_invalidCode_displayFlashMessage()
    {
        $flashBag = $this->getFlashBag();
        $session = $this->getSession($flashBag);
        $request = $this->getPostCodeRequest();
        $context = $this->getAuthenticationContext(null, $request, $session);
        $this->stubGoogleAuthenticator(false);
        //Invalid code
        //Mock the session flash bag
        $flashBag->expects($this->once())->method('set')->with('two_factor', 'scheb_two_factor.code_invalid');
        //Mock the template engine
        $this->renderer->expects($this->once())->method('render')->with($context)->willReturn(new Response('<form></form>'));
        $returnValue = $this->provider->requestAuthenticationCode($context);
        $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $returnValue);
        $this->assertEquals('<form></form>', $returnValue->getContent());
    }