示例#1
0
 public function testOptions()
 {
     $auth = new AuthenticationValidator(array('adapter' => $this->authAdapter, 'service' => $this->authService, 'identity' => 'username', 'credential' => 'password'));
     $this->assertSame($auth->getAdapter(), $this->authAdapter);
     $this->assertSame($auth->getService(), $this->authService);
     $this->assertSame($auth->getIdentity(), 'username');
     $this->assertSame($auth->getCredential(), 'password');
 }
示例#2
0
 public function getAuthenticationValidator()
 {
     if ($this->authenticationValidator === NULL) {
         $validator = new Authentication();
         $validator->setOptions($this->getAuthenticationConfig())->setMessages(array(Authentication::IDENTITY_NOT_FOUND => 'Invalid identity', Authentication::IDENTITY_AMBIGUOUS => 'Identity is ambiguous', Authentication::CREDENTIAL_INVALID => 'Invalid password', Authentication::UNCATEGORIZED => 'Authentication failed', Authentication::GENERAL => 'Authentication failed'));
         $this->setAuthenticationValidator($validator);
     }
     return $this->authenticationValidator;
 }