コード例 #1
0
 /**
  * Lists all queues in the storage account.
  * 
  * @param ListQueuesOptions $options The optional list queue options.
  * 
  * @return MicrosoftAzure\Storage\Queue\Models\ListQueuesResult
  */
 public function listQueues($options = null)
 {
     $method = Resources::HTTP_GET;
     $headers = array();
     $postParams = array();
     $queryParams = array();
     $path = Resources::EMPTY_STRING;
     $statusCode = Resources::STATUS_OK;
     if (is_null($options)) {
         $options = new ListQueuesOptions();
     }
     $timeout = $options->getTimeout();
     $maxResults = $options->getMaxResults();
     $include = $options->getIncludeMetadata();
     $include = $include ? 'metadata' : null;
     $prefix = $options->getPrefix();
     $marker = $options->getMarker();
     $this->addOptionalQueryParam($queryParams, Resources::QP_TIMEOUT, $timeout);
     $this->addOptionalQueryParam($queryParams, Resources::QP_COMP, 'list');
     $this->addOptionalQueryParam($queryParams, Resources::QP_PREFIX, $prefix);
     $this->addOptionalQueryParam($queryParams, Resources::QP_MARKER, $marker);
     $this->addOptionalQueryParam($queryParams, Resources::QP_INCLUDE, $include);
     $this->addOptionalQueryParam($queryParams, Resources::QP_MAX_RESULTS, $maxResults);
     $response = $this->send($method, $headers, $queryParams, $postParams, $path, $statusCode);
     $parsed = $this->dataSerializer->unserialize($response->getBody());
     return ListQueuesResult::create($parsed);
 }
コード例 #2
0
 public function testCheckListQueuesOptions()
 {
     $options = new ListQueuesOptions();
     $this->assertNull($options->getIncludeMetadata(), 'Default ListQueuesOptions->getIncludeMetadata');
     $this->assertNull($options->getMarker(), 'Default ListQueuesOptions->getMarker');
     $this->assertEquals(0, $options->getMaxResults(), 'Default ListQueuesOptions->getMaxResults');
     $this->assertNull($options->getPrefix(), 'Default ListQueuesOptions->getPrefix');
     $this->assertNull($options->getTimeout(), 'Default ListQueuesOptions->getTimeout');
     $options->setIncludeMetadata(true);
     $options->setMarker('foo');
     $options->setMaxResults(-10);
     $options->setPrefix('bar');
     $options->setTimeout(self::INT_MAX_VALUE);
     $this->assertTrue($options->getIncludeMetadata(), 'Set ListQueuesOptions->getIncludeMetadata');
     $this->assertEquals('foo', $options->getMarker(), 'Set ListQueuesOptions->getMarker');
     $this->assertEquals(-10, $options->getMaxResults(), 'Set ListQueuesOptions->getMaxResults');
     $this->assertEquals('bar', $options->getPrefix(), 'Set ListQueuesOptions->getPrefix');
     $this->assertEquals(self::INT_MAX_VALUE, $options->getTimeout(), 'Set ListQueuesOptions->getTimeout');
 }
コード例 #3
0
 /**
  * @covers MicrosoftAzure\Storage\Queue\Models\ListQueuesOptions::getMarker
  */
 public function testGetMarker()
 {
     // Setup
     $options = new ListQueuesOptions();
     $expected = 'mymarker';
     $options->setMarker($expected);
     // Test
     $actual = $options->getMarker();
     // Assert
     $this->assertEquals($expected, $actual);
 }