public function testParseValidXml() { $response = new ResponseCore(array(), $this->validXml, 200); $result = new GetWebsiteResult($response); $this->assertTrue($result->isOK()); $this->assertNotNull($result->getData()); $this->assertNotNull($result->getRawResponse()); $websiteConfig = $result->getData(); $this->assertEquals($this->cleanXml($this->validXml), $this->cleanXml($websiteConfig->serializeToXml())); }
/** * 获取bucket的静态网站托管状态 * * @param string $bucket bucket名称 * @param array $options * * @throws Exception * @return WebsiteConfig */ public function getBucketWebsite($bucket, $options = null) { $this->precheckCommon($bucket, null, $options, false); $options[self::OSS_BUCKET] = $bucket; $options[self::OSS_METHOD] = self::OSS_HTTP_GET; $options[self::OSS_OBJECT] = '/'; $options[self::OSS_SUB_RESOURCE] = 'website'; $response = $this->auth($options); $result = new GetWebsiteResult($response); return $result->getData(); }