Scheb\TwoFactorBundle\Tests\Security\TwoFactor\Session\SessionFlagManagerTest::isNotAuthenticated_notHasFlag_returnFalse PHP Method

isNotAuthenticated_notHasFlag_returnFalse() public method

    public function isNotAuthenticated_notHasFlag_returnFalse()
    {
        $token = $this->createMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface');
        //Mock the SessionFlagGenerator
        $this->flagGenerator->expects($this->once())->method('getSessionFlag')->with('providerName', $token)->willReturn('session_flag');
        //Mock the Session
        $this->session->expects($this->once())->method('isStarted')->willReturn($this->returnValue(true));
        $this->session->expects($this->once())->method('has')->with('session_flag')->willReturn(false);
        $returnValue = $this->sessionFlagManager->isNotAuthenticated('providerName', $token);
        $this->assertFalse($returnValue);
    }