當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Auth_OpenID_Message::getOpenIDNamespace方法代碼示例

本文整理匯總了PHP中Auth_OpenID_Message::getOpenIDNamespace方法的典型用法代碼示例。如果您正苦於以下問題:PHP Auth_OpenID_Message::getOpenIDNamespace方法的具體用法?PHP Auth_OpenID_Message::getOpenIDNamespace怎麽用?PHP Auth_OpenID_Message::getOpenIDNamespace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Auth_OpenID_Message的用法示例。


在下文中一共展示了Auth_OpenID_Message::getOpenIDNamespace方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

 function test_answerImmediateDenyOpenID1()
 {
     $msg = new Auth_OpenID_Message(Auth_OpenID_OPENID1_NS);
     $this->request->message = $msg;
     $this->request->namespace = $msg->getOpenIDNamespace();
     $this->request->mode = 'checkid_immediate';
     $this->request->claimed_id = 'http://claimed-id.test/';
     $this->request->immediate = true;
     $server_url = "http://setup-url.unittest/";
     $answer = $this->request->answer(false, $server_url);
     $this->assertEquals($answer->request, $this->request);
     $this->assertEquals(count($answer->fields->toPostArgs()), 2);
     $this->assertEquals($answer->fields->getOpenIDNamespace(), Auth_OpenID_OPENID1_NS);
     $this->assertTrue($answer->fields->namespaces->isImplicit(Auth_OpenID_OPENID1_NS));
     $this->assertEquals($answer->fields->getArg(Auth_OpenID_OPENID_NS, 'mode'), 'id_res');
     $usu = $answer->fields->getArg(Auth_OpenID_OPENID_NS, 'user_setup_url');
     $this->assertTrue(strpos($usu, $server_url) == 0);
     $expected_substr = 'openid.claimed_id=http%3A%2F%2Fclaimed-id.test%2F';
     $this->assertTrue(strpos($usu, $expected_substr), $usu);
 }
開發者ID:alexandreeffetb,項目名稱:yos-social-php5,代碼行數:20,代碼來源:Server.php

示例2:

 function test_isOpenID2()
 {
     $ns = 'http://specs.openid.net/auth/2.0';
     $m = new Auth_OpenID_Message($ns);
     $this->assertTrue($m->isOpenID2());
     $this->assertFalse($m->namespaces->isImplicit(Auth_OpenID_NULL_NAMESPACE));
     $this->assertEquals($ns, $m->getOpenIDNamespace());
 }
開發者ID:BGCX067,項目名稱:ezopenid-svn-to-git,代碼行數:8,代碼來源:Message.php

示例3: array

 function _test($uri)
 {
     // Create a request message with simple registration fields
     $sreg_req = Auth_OpenID_SRegRequest::build(array('nickname', 'email'), array('fullname'));
     $req_msg = new Auth_OpenID_Message($uri);
     $req_msg->updateArgs(Auth_OpenID_SREG_NS_URI, $sreg_req->getExtensionArgs());
     $req = new Auth_OpenID_Request();
     $req->message =& $req_msg;
     $req->namespace = $req_msg->getOpenIDNamespace();
     // -> send checkid_* request
     // Create an empty response message
     $resp_msg = new Auth_OpenID_Message($uri);
     $resp = new Auth_OpenID_ServerResponse($req);
     $resp->fields = $resp_msg;
     $data = array('nickname' => 'linusaur', 'postcode' => '12345', 'country' => 'US', 'gender' => 'M', 'fullname' => 'Leonhard Euler', 'email' => 'president@whitehouse.gov', 'dob' => '0000-00-00', 'language' => 'en-us');
     // Put the requested data fields in the response message
     $sreg_resp = Auth_OpenID_SRegResponse::extractResponse($sreg_req, $data);
     $resp->addExtension($sreg_resp);
     // <- send id_res response
     // Extract the fields that were sent
     $sreg_data_resp = $resp->fields->getArgs(Auth_OpenID_SREG_NS_URI);
     $this->assertEquals(array('nickname' => 'linusaur', 'email' => 'president@whitehouse.gov', 'fullname' => 'Leonhard Euler'), $sreg_data_resp);
 }
開發者ID:BGCX067,項目名稱:ezopenid-svn-to-git,代碼行數:23,代碼來源:SReg.php


注:本文中的Auth_OpenID_Message::getOpenIDNamespace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。