eZ\Publish\Core\MVC\Symfony\Security\Tests\Authentication\RepositoryAuthenticationProviderTest::testCheckAuthenticationCredentialsChanged PHP Метод

testCheckAuthenticationCredentialsChanged() публичный Метод

    public function testCheckAuthenticationCredentialsChanged()
    {
        $apiUser = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\Values\\User\\User')->setConstructorArgs(array(array('passwordHash' => 'some_encoded_password')))->getMockForAbstractClass();
        $tokenUser = new User($apiUser);
        $token = new UsernamePasswordToken($tokenUser, 'foo', 'bar');
        $renewedApiUser = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\Values\\User\\User')->setConstructorArgs(array(array('passwordHash' => 'renewed_encoded_password')))->getMockForAbstractClass();
        $user = $this->getMock('eZ\\Publish\\Core\\MVC\\Symfony\\Security\\User');
        $user->expects($this->any())->method('getAPIUser')->will($this->returnValue($renewedApiUser));
        $method = new \ReflectionMethod($this->authProvider, 'checkAuthentication');
        $method->setAccessible(true);
        $method->invoke($this->authProvider, $user, $token);
    }