/**
  * @covers WindowsAzure\Blob\BlobRestProxy::listContainers
  */
 public function testListContainersWithInvalidNextMarkerFail()
 {
     $this->skipIfEmulated();
     // Setup
     $container1 = 'listcontainerswithinvalidnextmarker1' . $this->createSuffix();
     $container2 = 'listcontainerswithinvalidnextmarker2' . $this->createSuffix();
     $container3 = 'listcontainerswithinvalidnextmarker3' . $this->createSuffix();
     parent::createContainer($container1);
     parent::createContainer($container2);
     parent::createContainer($container3);
     $options = new ListContainersOptions();
     $options->setMaxResults('2');
     $this->setExpectedException(get_class(new ServiceException('409')));
     // Test
     $this->restProxy->listContainers($options);
     $options->setMarker('wrong marker');
     $this->restProxy->listContainers($options);
 }
 public static function getInterestingListContainersOptions()
 {
     $ret = array();
     $options = new ListContainersOptions();
     array_push($ret, $options);
     $options = new ListContainersOptions();
     $marker = '/' . self::$_accountName . '/' . self::$testContainerNames[1];
     $options->setMarker($marker);
     array_push($ret, $options);
     $options = new ListContainersOptions();
     $marker = '/' . self::$_accountName . '/' . self::$nonExistContainerPrefix;
     $options->setMarker($marker);
     array_push($ret, $options);
     $options = new ListContainersOptions();
     $maxResults = 2;
     $options->setMaxResults($maxResults);
     array_push($ret, $options);
     $options = new ListContainersOptions();
     $prefix = self::$testUniqueId;
     $options->setPrefix($prefix);
     array_push($ret, $options);
     $options = new ListContainersOptions();
     $prefix = self::$nonExistContainerPrefix;
     $options->setPrefix($prefix);
     array_push($ret, $options);
     $options = new ListContainersOptions();
     $prefix = self::$testContainerNames[1];
     $options->setPrefix($prefix);
     array_push($ret, $options);
     $options = new ListContainersOptions();
     $timeout = -1;
     $options->setTimeout($timeout);
     array_push($ret, $options);
     $options = new ListContainersOptions();
     $timeout = 60;
     $options->setTimeout($timeout);
     array_push($ret, $options);
     $options = new ListContainersOptions();
     $includeMetadata = true;
     $options->setIncludeMetadata($includeMetadata);
     array_push($ret, $options);
     $options = new ListContainersOptions();
     $marker = '/' . self::$_accountName . '/' . self::$testContainerNames[1];
     $maxResults = 2;
     $prefix = self::$testUniqueId;
     $timeout = 60;
     $includeMetadata = true;
     $options->setMarker($marker);
     $options->setMaxResults($maxResults);
     $options->setPrefix($prefix);
     $options->setTimeout($timeout);
     $options->setIncludeMetadata($includeMetadata);
     array_push($ret, $options);
     return $ret;
 }
 /**
  * @covers WindowsAzure\Blob\Models\ListContainersOptions::getMaxResults
  */
 public function testGetMaxResults()
 {
     // Setup
     $options = new ListContainersOptions();
     $expected = '3';
     $options->setMaxResults($expected);
     // Test
     $actual = $options->getMaxResults();
     // Assert
     $this->assertEquals($expected, $actual);
 }
 /**
  * @covers WindowsAzure\Blob\BlobRestProxy::listContainers
  */
 public function testListContainersWithPrefixWorks()
 {
     // Act
     $opts = new ListContainersOptions();
     $opts->setPrefix(self::$_testContainersPrefix);
     $opts->setMaxResults(3);
     $results = $this->restProxy->listContainers($opts);
     // Assert
     $this->assertNotNull($results, '$results');
     $this->assertEquals(3, count($results->getContainers()), 'count($results->getContainers())');
     $this->assertNotNull($results->getNextMarker(), '$results->getNextMarker()');
     $this->assertEquals(3, $results->getMaxResults(), '$results->getMaxResults()');
     // Act
     $opts = new ListContainersOptions();
     $opts->setPrefix(self::$_testContainersPrefix);
     $opts->setMarker($results->getNextMarker());
     $results2 = $this->restProxy->listContainers($opts);
     // Assert
     $this->assertNotNull($results2, '$results2');
     $this->assertNull($results2->getNextMarker(), '$results2->getNextMarker()');
     $this->assertEquals(0, $results2->getMaxResults(), '$results2->getMaxResults()');
     // Act
     $opts = new ListContainersOptions();
     $opts->setPrefix(self::$_testContainersPrefix);
     $results3 = $this->restProxy->listContainers($opts);
     // Assert
     $this->assertEquals(count($results->getContainers()) + count($results2->getContainers()), count($results3->getContainers()), 'count($results3->getContainers())');
 }