Example #1
0
 /**
  * Lists all queues in the storage account.
  * 
  * @param ListQueuesOptions $options The optional list queue options.
  * 
  * @return WindowsAzure\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);
 }
 /**
  * @covers WindowsAzure\Queue\Models\ListQueuesOptions::getPrefix
  */
 public function testGetPrefix()
 {
     // Setup
     $options = new ListQueuesOptions();
     $expected = 'myprefix';
     $options->setPrefix($expected);
     // Test
     $actual = $options->getPrefix();
     // Assert
     $this->assertEquals($expected, $actual);
 }
 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');
 }
 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');
     // TODO: Revert this change when fixed
     // https://github.com/WindowsAzure/azure-sdk-for-php/issues/69
     // $options->setMaxResults(-10);
     $options->setMaxResults('-10');
     $options->setPrefix('bar');
     $options->setTimeout(self::IntegerMAX_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::IntegerMAX_VALUE, $options->getTimeout(), 'Set ListQueuesOptions->getTimeout');
 }