Scheb\TwoFactorBundle\Tests\Security\TwoFactor\Trusted\TrustedCookieManagerTest::createTrustedCookie_newTrustedToken_persistUserEntity PHP Method

createTrustedCookie_newTrustedToken_persistUserEntity() public method

    public function createTrustedCookie_newTrustedToken_persistUserEntity()
    {
        $user = $this->createMock('Scheb\\TwoFactorBundle\\Model\\TrustedComputerInterface');
        $request = $this->createRequest();
        //Stub the TrustedTokenGenerator
        $this->tokenGenerator->expects($this->once())->method('generateToken')->willReturn('newTrustedCode');
        //Mock the TrustedComputerManager object
        $this->trustedComputerManager->expects($this->once())->method('addTrustedComputer')->with($user, 'newTrustedCode');
        $this->cookieManager->createTrustedCookie($request, $user);
    }