Exemplo n.º 1
0
 function test1()
 {
     $ch = curl_init("http://example.com?foo=bar");
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     $response = curl_exec($ch);
     curl_close($ch);
     TestUtils::assertTrue(isset($response));
 }
Exemplo n.º 2
0
 static function test15()
 {
     require '../OauthPanda.class.php';
     $foo = new OauthPanda(array('exception_handling' => 'throw', 'request_client' => new YahooCurlWrapper('../YahooCurl.class.php'), 'oauth_client' => new StandardOauthWrapper('../OAuth.php'), 'consumer_key' => YAHOO_OAUTH_CONSUMER_KEY, 'consumer_secret' => YAHOO_OAUTH_CONSUMER_SECRET));
     try {
         $response = $foo->GET(array('url' => 'https://api.login.yahoo.com/oauth/v2/get_request_token', 'params' => array('oauth_callback' => OAUTH_CALLBACK_URL)));
         //we should get a request token back
         TestUtils::assertTrue(false !== strpos($response['response_body'], 'oauth_token='));
     } catch (Exception $e) {
         //no exception should be thrown
         TestUtils::assertTrue(false, '' . print_r($e, true));
     }
 }