/**
  * @covers WindowsAzure\Table\Models\QueryTablesOptions::setNextTableName
  * @covers WindowsAzure\Table\Models\QueryTablesOptions::getNextTableName
  */
 public function testSetNextTableName()
 {
     // Setup
     $options = new QueryTablesOptions();
     $expected = 'table';
     // Test
     $options->setNextTableName($expected);
     // Assert
     $this->assertEquals($expected, $options->getNextTableName());
 }
 static function getInterestingQueryTablesOptions()
 {
     $ret = array();
     $options = new QueryTablesOptions();
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $options->setTop(2);
     $options->setPrefix(self::$nonExistTablePrefix);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $options->setTop(-2);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $filter = Filter::applyEq(Filter::applyConstant(self::$TEST_TABLE_NAMES[1]), Filter::applyPropertyName('TableName'));
     $options->setFilter($filter);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $filter = Filter::applyEq(Filter::applyConstant(self::$TEST_TABLE_NAMES[2]), Filter::applyPropertyName('TableName'));
     $options->setFilter($filter);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $filter = Filter::applyAnd(Filter::applyEq(Filter::applyConstant(self::$TEST_TABLE_NAMES[1]), Filter::applyPropertyName('TableName')), Filter::applyEq(Filter::applyConstant(self::$TEST_TABLE_NAMES[2]), Filter::applyPropertyName('TableName')));
     $options->setFilter($filter);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $filter = Filter::applyAnd(Filter::applyGe(Filter::applyPropertyName('TableName'), Filter::applyConstant(self::$TEST_TABLE_NAMES[1])), Filter::applyLe(Filter::applyPropertyName('TableName'), Filter::applyConstant(self::$TEST_TABLE_NAMES[2])));
     $options->setFilter($filter);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $filter = Filter::applyOr(Filter::applyGe(Filter::applyPropertyName('TableName'), Filter::applyConstant(self::$TEST_TABLE_NAMES[1])), Filter::applyGe(Filter::applyPropertyName('TableName'), Filter::applyConstant(self::$TEST_TABLE_NAMES[2])));
     $options->setFilter($filter);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $filter = Filter::applyAnd(Filter::applyEq(Filter::applyPropertyName('TableName'), Filter::applyConstant(self::$TEST_TABLE_NAMES[1])), Filter::applyGe(Filter::applyPropertyName('TableName'), Filter::applyConstant(self::$TEST_TABLE_NAMES[0])));
     $options->setFilter($filter);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $filter = Filter::applyOr(Filter::applyEq(Filter::applyPropertyName('TableName'), Filter::applyConstant(self::$TEST_TABLE_NAMES[1])), Filter::applyGe(Filter::applyPropertyName('TableName'), Filter::applyConstant(self::$TEST_TABLE_NAMES[2])));
     $options->setFilter($filter);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $filter = Filter::applyOr(Filter::applyEq(Filter::applyPropertyName('TableName'), Filter::applyConstant(self::$TEST_TABLE_NAMES[1])), Filter::applyEq(Filter::applyPropertyName('TableName'), Filter::applyConstant(self::$TEST_TABLE_NAMES[2])));
     $options->setFilter($filter);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $filter = Filter::applyOr(Filter::applyEq(Filter::applyConstant(self::$TEST_TABLE_NAMES[1]), Filter::applyPropertyName('TableName')), Filter::applyEq(Filter::applyConstant(self::$TEST_TABLE_NAMES[2]), Filter::applyPropertyName('TableName')));
     $options->setFilter($filter);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $options->setPrefix(self::$nonExistTablePrefix);
     array_push($ret, $options);
     if (!Configuration::isEmulated()) {
         $options = new QueryTablesOptions();
         $options->setPrefix(self::$testUniqueId);
         array_push($ret, $options);
     }
     $options = new QueryTablesOptions();
     $nextTableName = self::$TEST_TABLE_NAMES[1];
     $options->setNextTableName($nextTableName);
     array_push($ret, $options);
     $options = new QueryTablesOptions();
     $nextTableName = self::$nonExistTablePrefix;
     $options->setNextTableName($nextTableName);
     array_push($ret, $options);
     return $ret;
 }
 public function testCheckQueryTablesOptions()
 {
     $options = new QueryTablesOptions();
     $nextTableName = 'foo';
     $filter = new Filter();
     $this->assertNull($options->getNextTableName(), 'Default QueryTablesOptions->getNextTableName');
     $this->assertNotNull($options->getQuery(), 'Default QueryTablesOptions->getQuery');
     $options->setNextTableName($nextTableName);
     $options->setFilter($filter);
     $options->setTop(10);
     $this->assertEquals($nextTableName, $options->getNextTableName(), 'Set QueryTablesOptions->getNextTableName');
     $this->assertEquals($filter, $options->getFilter(), 'Set QueryTablesOptions->getFilter');
     $this->assertEquals($filter, $options->getQuery()->getFilter(), 'Set QueryTablesOptions->getQuery->getFilter');
     $this->assertEquals(10, $options->getTop(), 'Set QueryTablesOptions->getTop');
     $this->assertEquals(10, $options->getQuery()->getTop(), 'Set QueryTablesOptions->getQuery->getTop');
 }
 /**
  * Lists all tables in this storage service.
  * 
  * @return array
  */
 public function listTables()
 {
     $nextTableName = null;
     $tables = array();
     do {
         $options = new QueryTablesOptions();
         $options->setNextTableName($nextTableName);
         $result = $this->_tableProxy->queryTables();
         $nextTableName = $result->getNextTableName();
         $tables = array_merge($tables, $result->getTables());
     } while (!is_null($nextTableName));
     return $tables;
 }