public function listBuckets($options = NULL) { if ($this->hostType === self::OSS_HOST_TYPE_CNAME) { throw new OssException("operation is not permitted with CName host"); } $this->precheckOptions($options); $options[self::OSS_BUCKET] = ''; $options[self::OSS_METHOD] = self::OSS_HTTP_GET; $options[self::OSS_OBJECT] = '/'; $response = $this->auth($options); $result = new ListBucketsResult($response); return $result->getData(); }
public function testConstrunct8() { try { $ossClient = new OssClient(Config::OSS_ACCESS_ID, Config::OSS_ACCESS_KEY, "http://123.123.123.1", true); $ossClient->listBuckets(); $this->assertFalse(true); } catch (OssException $e) { } }