Auth_OpenID_Message::fromOpenIDArgs PHP Method

fromOpenIDArgs() static public method

static public fromOpenIDArgs ( $openid_args )
    static function fromOpenIDArgs($openid_args)
    {
        // Takes an array.
        // Construct a Message from a parsed KVForm message
        $obj = new Auth_OpenID_Message();
        if ($obj->_fromOpenIDArgs($openid_args)) {
            return $obj;
        } else {
            return null;
        }
    }

Usage Example

Example #1
0
 function test_fromSuccessResponse()
 {
     $name = "ziggy";
     $value = "stardust";
     $uri = "http://david.bowie.name/";
     $args = array('mode' => 'id_res', 'ns' => Auth_OpenID_OPENID2_NS, 'ns.ax' => Auth_OpenID_AX_NS_URI, 'ax.mode' => 'fetch_response', 'ax.update_url' => 'http://example.com/realm/update_path', 'ax.type.' . $name => $uri, 'ax.count.' . $name => '1', 'ax.value.' . $name . '.1' => $value);
     $sf = array();
     foreach (array_keys($args) as $k) {
         array_push($sf, $k);
     }
     $msg = Auth_OpenID_Message::fromOpenIDArgs($args);
     $e = new FauxEndpoint();
     $resp = new Auth_OpenID_SuccessResponse($e, $msg, $sf);
     $ax_resp = Auth_OpenID_AX_FetchResponse::fromSuccessResponse($resp, false);
     $this->assertFalse($ax_resp === null);
     $this->assertTrue(is_a($ax_resp, 'Auth_OpenID_AX_FetchResponse'));
     $values = $ax_resp->get($uri);
     $this->assertEquals(array($value), $values);
 }
All Usage Examples Of Auth_OpenID_Message::fromOpenIDArgs