whichEncoding() публичный Метод

public whichEncoding ( )
Пример #1
0
 function test_id_res_OpenID1_exceeds_limit()
 {
     /* Check that when an OpenID 1 response exceeds the OpenID 1
        message size, a GET response is issued.  Technically, this
        shouldn't be permitted by the library, but this test is in
        place to preserve the status quo for OpenID 1. */
     $request = new Auth_OpenID_CheckIDRequest('http://bombom.unittest/', 'http://burr.unittest/999', 'http://burr.unittest/', false, $this->server->op_endpoint);
     $response = new Auth_OpenID_ServerResponse($request);
     $response->fields = Auth_OpenID_Message::fromOpenIDArgs(array('mode' => 'id_res', 'identity' => $request->identity, 'return_to' => str_repeat('x', Auth_OpenID_OPENID1_URL_LIMIT)));
     $this->assertFalse($response->renderAsForm());
     $this->assertTrue(strlen($response->encodeToURL()) > Auth_OpenID_OPENID1_URL_LIMIT);
     $this->assertTrue($response->whichEncoding() == Auth_OpenID_ENCODE_URL);
     $webresponse = $this->encode($response);
     $this->assertEquals($webresponse->headers['location'], $response->encodeToURL());
 }