Exemplo n.º 1
0
 public function testGetAuthSubTokenUriModifiedBase()
 {
     $uri = GData\AuthSub::getAuthSubTokenUri('http://www.example.com/foo.php', 'http://www.google.com/calendar/feeds', 0, 1, 'http://www.otherauthservice.com/accounts/AuthSubRequest');
     // Note: the scope here is not encoded.  It should be encoded,
     // but the method getAuthSubTokenUri calls urldecode($scope).
     // This currently works (no reported bugs) as web browsers will
     // handle the encoding in most cases.
     $this->assertEquals('http://www.otherauthservice.com/accounts/AuthSubRequest?next=http%3A%2F%2Fwww.example.com%2Ffoo.php&scope=http://www.google.com/calendar/feeds&secure=0&session=1', $uri);
 }
Exemplo n.º 2
0
 public function testGetHttpClientProvidesNewClientWhenNullPassed()
 {
     $client = GData\AuthSub::getHttpClient($this->token);
     $this->assertTrue($client instanceof GData\HttpClient);
     $this->assertEquals($this->token, $client->getAuthSubToken());
 }