public function testParseValidXml2()
 {
     $response = new ResponseCore(array(), $this->validXml2, 200);
     $result = new ListObjectsResult($response);
     $this->assertTrue($result->isOK());
     $this->assertNotNull($result->getData());
     $this->assertNotNull($result->getRawResponse());
     $objectListInfo = $result->getData();
     $this->assertEquals(0, count($objectListInfo->getPrefixList()));
     $this->assertEquals(1, count($objectListInfo->getObjectList()));
     $this->assertEquals('testbucket-hf', $objectListInfo->getBucketName());
     $this->assertEquals('oss-php-sdk-test/', $objectListInfo->getPrefix());
     $this->assertEquals('xx', $objectListInfo->getMarker());
     $this->assertEquals(1000, $objectListInfo->getMaxKeys());
     $this->assertEquals('/', $objectListInfo->getDelimiter());
     $this->assertEquals('false', $objectListInfo->getIsTruncated());
     $this->assertEquals('oss-php-sdk-test/upload-test-object-name.txt', $objectListInfo->getObjectList()[0]->getKey());
     $this->assertEquals('2015-11-18T03:36:00.000Z', $objectListInfo->getObjectList()[0]->getLastModified());
     $this->assertEquals('"89B9E567E7EB8815F2F7D41851F9A2CD"', $objectListInfo->getObjectList()[0]->getETag());
     $this->assertEquals('Normal', $objectListInfo->getObjectList()[0]->getType());
     $this->assertEquals(13115, $objectListInfo->getObjectList()[0]->getSize());
     $this->assertEquals('Standard', $objectListInfo->getObjectList()[0]->getStorageClass());
 }
示例#2
0
 public function testParseValidXmlWithEncodedKey()
 {
     $response = new ResponseCore(array(), $this->validXmlWithEncodedKey, 200);
     $result = new ListObjectsResult($response);
     $this->assertTrue($result->isOK());
     $this->assertNotNull($result->getData());
     $this->assertNotNull($result->getRawResponse());
     $objectListInfo = $result->getData();
     $this->assertEquals(0, count($objectListInfo->getPrefixList()));
     $this->assertEquals(1, count($objectListInfo->getObjectList()));
     $this->assertEquals('testbucket-hf', $objectListInfo->getBucketName());
     $this->assertEquals('php/prefix', $objectListInfo->getPrefix());
     $this->assertEquals('php/marker', $objectListInfo->getMarker());
     $this->assertEquals('php/next-marker', $objectListInfo->getNextMarker());
     $this->assertEquals(1000, $objectListInfo->getMaxKeys());
     $this->assertEquals('/', $objectListInfo->getDelimiter());
     $this->assertEquals('true', $objectListInfo->getIsTruncated());
     $objects = $objectListInfo->getObjectList();
     $this->assertEquals('php/a+b', $objects[0]->getKey());
     $this->assertEquals('2015-11-18T03:36:00.000Z', $objects[0]->getLastModified());
     $this->assertEquals('"89B9E567E7EB8815F2F7D41851F9A2CD"', $objects[0]->getETag());
     $this->assertEquals('Normal', $objects[0]->getType());
     $this->assertEquals(13115, $objects[0]->getSize());
     $this->assertEquals('Standard', $objects[0]->getStorageClass());
 }