Ejemplo n.º 1
0
 /**
  * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::getContainerMetadata
  * @covers MicrosoftAzure\Storage\Blob\BlobRestProxy::_getContainerPropertiesImpl
  */
 public function testGetContainerMetadata()
 {
     // Setup
     $name = 'getcontainermetadata' . $this->createSuffix();
     $options = new CreateContainerOptions();
     $expected = array('name1' => 'MyName1', 'mymetaname' => '12345', 'values' => 'Microsoft_');
     $options->setMetadata($expected);
     $this->createContainer($name, $options);
     $result = $this->restProxy->getContainerProperties($name);
     $expectedETag = $result->getETag();
     $expectedLastModified = $result->getLastModified();
     // Test
     $result = $this->restProxy->getContainerMetadata($name);
     // Assert
     $this->assertEquals($expectedETag, $result->getETag());
     $this->assertEquals($expectedLastModified, $result->getLastModified());
     $this->assertEquals($expected, $result->getMetadata());
 }
 public static function getInterestingCreateContainerOptions()
 {
     $ret = array();
     $options = new CreateContainerOptions();
     array_push($ret, $options);
     $options = new CreateContainerOptions();
     $options->setTimeout(10);
     array_push($ret, $options);
     $options = new CreateContainerOptions();
     $options->setTimeout(-10);
     array_push($ret, $options);
     $options = new CreateContainerOptions();
     $options->setPublicAccess('container');
     array_push($ret, $options);
     $options = new CreateContainerOptions();
     $options->setPublicAccess('blob');
     array_push($ret, $options);
     $options = new CreateContainerOptions();
     $metadata = array('foo' => 'bar', 'boo' => 'baz');
     $options->setMetadata($metadata);
     array_push($ret, $options);
     return $ret;
 }
 /**
  * @covers MicrosoftAzure\Storage\Blob\Models\CreateContainerOptions::getMetadata
  */
 public function testGetMetadata()
 {
     // Setup
     $container = new CreateContainerOptions();
     $expected = array('key1' => 'value1', 'key2' => 'value2');
     $container->setMetadata($expected);
     // Test
     $actual = $container->getMetadata();
     // Assert
     $this->assertEquals($expected, $actual);
 }