/**
  * @covers MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions::setRangeStart
  * @covers MicrosoftAzure\Storage\Blob\Models\ListPageBlobRangesOptions::getRangeStart
  */
 public function testSetRangeStart()
 {
     // Setup
     $expected = 123;
     $prooperties = new ListPageBlobRangesOptions();
     $prooperties->setRangeStart($expected);
     // Test
     $prooperties->setRangeStart($expected);
     // Assert
     $this->assertEquals($expected, $prooperties->getRangeStart());
 }
Ejemplo n.º 2
0
 /**
  * Returns a list of active page ranges for a page blob. Active page ranges are 
  * those that have been populated with data.
  * 
  * @param string                           $container name of the container
  * @param string                           $blob      name of the blob
  * @param Models\ListPageBlobRangesOptions $options   optional parameters
  * 
  * @return Models\ListPageBlobRangesResult
  * 
  * @see http://msdn.microsoft.com/en-us/library/windowsazure/ee691973.aspx
  */
 public function listPageBlobRanges($container, $blob, $options = null)
 {
     Validate::isString($container, 'container');
     Validate::isString($blob, 'blob');
     Validate::notNullOrEmpty($blob, 'blob');
     $method = Resources::HTTP_GET;
     $headers = array();
     $queryParams = array();
     $postParams = array();
     $path = $this->_createPath($container, $blob);
     $statusCode = Resources::STATUS_OK;
     if (is_null($options)) {
         $options = new ListPageBlobRangesOptions();
     }
     $headers = $this->addOptionalAccessConditionHeader($headers, $options->getAccessCondition());
     $headers = $this->_addOptionalRangeHeader($headers, $options->getRangeStart(), $options->getRangeEnd());
     $this->addOptionalHeader($headers, Resources::X_MS_LEASE_ID, $options->getLeaseId());
     $this->addOptionalQueryParam($queryParams, Resources::QP_SNAPSHOT, $options->getSnapshot());
     $this->addOptionalQueryParam($queryParams, Resources::QP_TIMEOUT, $options->getTimeout());
     $this->addOptionalQueryParam($queryParams, Resources::QP_COMP, 'pagelist');
     $response = $this->send($method, $headers, $queryParams, $postParams, $path, $statusCode);
     $parsed = $this->dataSerializer->unserialize($response->getBody());
     return ListPageBlobRangesResult::create(HttpFormatter::formatHeaders($response->getHeaders()), $parsed);
 }