http://www.b.com http://www.a.com http://www.a.com GET PUT POST x-oss-test x-oss-test2 x-oss-test2 x-oss-test3 x-oss-test1 x-oss-test1 x-oss-test2 10 http://www.b.com GET x-oss-test x-oss-test1 110 BBBB; public function testParseValidXml() { $response = new ResponseCore(array(), $this->validXml, 200); $result = new GetCorsResult($response); $this->assertTrue($result->isOK()); $this->assertNotNull($result->getData()); $this->assertNotNull($result->getRawResponse()); $corsConfig = $result->getData(); $this->assertEquals($this->cleanXml($this->validXml), $this->cleanXml($corsConfig->serializeToXml())); } private function cleanXml($xml) { return str_replace("\n", "", str_replace("\r", "", $xml)); } public function testInvalidResponse() { $response = new ResponseCore(array(), $this->validXml, 300); try { $result = new GetCorsResult($response); $this->assertTrue(false); } catch (OssException $e) { $this->assertTrue(true); } } }