示例#1
0
文件: Client.php 项目: endel/hook-cli
 public static function setEndpoint($endpoint)
 {
     if (substr($endpoint, -strlen('/')) !== '/') {
         $endpoint .= '/';
     }
     static::$endpoint = $endpoint;
 }
示例#2
0
 /**
  * Run before all tests.
  */
 public static function setUpBeforeClass()
 {
     global $argv, $argc;
     // Get variables from the unit test command string.
     static::$api_key = isset($argv[6]) ? $argv[6] : '';
     static::$api_key_secret = isset($argv[7]) ? $argv[7] : '';
     static::$endpoint = isset($argv[8]) ? $argv[8] : '';
     static::$endpoint_method = isset($argv[9]) ? strtolower($argv[9]) : '';
     static::$endpoint_path = isset($argv[10]) ? $argv[10] : '';
     fwrite(STDOUT, "\nPushAPI Unit Tests:\n\n");
     // Make sure user provides credentials to test PublisherAPI endpoints.
     if (empty(static::$api_key) && empty(static::$api_key_secret) && empty(static::$endpoint)) {
         fwrite(STDOUT, "Please specify PublisherAPI credentials. See documentation for more details about PublisherAPI unit tests.\n");
         fwrite(STDOUT, "When no credentials specified, only PublisherAPI helper methods will be tested.\n\n");
     }
 }