Ejemplo n.º 1
0
 public function testOpenidWrapperRunModeIdResDbStoreNonceInvalid()
 {
     $_GET = self::$requestCheckAuthenticationGet;
     $_GET['openid_mode'] = 'id_res';
     $nonce = '123456';
     $_GET['openid_return_to'] = ezcAuthenticationUrl::appendQuery($_GET['openid_return_to'], 'nonce', $nonce);
     $options = new ezcAuthenticationOpenidOptions();
     $options->store = new ezcAuthenticationOpenidDbStore($this->db);
     $credentials = new ezcAuthenticationIdCredentials(self::$url);
     $filter = new ezcAuthenticationOpenidWrapper($options);
     $result = $filter->run($credentials);
     $this->assertEquals(ezcAuthenticationOpenidFilter::STATUS_NONCE_INCORRECT, $result);
 }
Ejemplo n.º 2
0
 public function testOpenidWrapperRunModeUnknown()
 {
     $_GET = self::$requestCheckAuthenticationGet;
     $_GET['openid_mode'] = 'no such mode';
     $credentials = new ezcAuthenticationIdCredentials(self::$url);
     $filter = new ezcAuthenticationOpenidWrapper();
     try {
         $result = $filter->run($credentials);
         $this->fail("Expected exception was not thrown.");
     } catch (ezcAuthenticationOpenidException $e) {
         $expected = "OpenID request not supported: 'openid_mode = no such mode'.";
         $this->assertEquals($expected, $e->getMessage());
     }
 }