コード例 #1
0
 public function testAdvancedAuthenticationUrl()
 {
     $this->configuration->makeAdvancedAuthenticationType();
     $expectedAction = 'Test.ff';
     $this->parameters['format'] = 'json';
     $expectedPath = '/' . $this->configuration->getContext() . '/' . $expectedAction;
     $url = $this->urlBuilder->getAuthenticationUrl($expectedAction, $this->parameters);
     $tempParameters = array();
     parse_str(parse_url($url, PHP_URL_QUERY), $tempParameters);
     $timestamp = $tempParameters['timestamp'];
     $pwHash = md5($this->configuration->getPassword());
     $prefix = $this->configuration->getAuthenticationPrefix();
     $postfix = $this->configuration->getAuthenticationPostfix();
     $expectedParameters = array('channel' => 'de', 'format' => 'json', 'timestamp' => $timestamp, 'username' => $this->configuration->getUserName(), 'password' => md5($prefix . time() . "000" . $pwHash . $postfix));
     $this->assertUrlEquals($expectedPath, $expectedParameters, $this->urlBuilder->getAuthenticationUrl($expectedAction, $this->parameters));
 }