public function testRequest() { require __DIR__ . '/cfgs/ads_config.php'; if (isset($proxyHost) && isset($proxyPort)) { RestfulEnvironment::setProxy($proxyHost, $proxyPort); } if (isset($allowAllCerts)) { RestfulEnvironment::setAcceptAllCerts($allowAllCerts); } $tokenSrvc = new OAuthTokenService($FQDN, $api_key, $secret_key); $token = $tokenSrvc->getToken('ADS'); $this->assertTrue($token->getAccessToken() != ''); $token = $tokenSrvc->refreshToken($token); $this->assertTrue($token->getAccessToken() != ''); }
/** * Sets whether to accept all certificates. * * Useful for handling self-signed certificates, but should not be used on * production. * * @param boolean $shouldAccept true if to accept all certificates, false * otherwise * * @return void */ public static function setAcceptAllCerts($shouldAccept) { RestfulEnvironment::$_acceptAllCerts = $shouldAccept; }