private function verifyqueryTablesWorker($ret, $options)
 {
     $this->assertNotNull($ret->getTables(), 'getTables');
     $effectivePrefix = $options->getPrefix();
     if (is_null($effectivePrefix)) {
         $effectivePrefix = '';
     }
     $expectedFilter = $options->getFilter();
     if (TableServiceFunctionalTestUtils::isEqNotInTopLevel($expectedFilter)) {
         // This seems wrong, but appears to be a bug in the $service itself.
         // So working around the limitation.
         $expectedFilter = TableServiceFunctionalTestUtils::cloneRemoveEqNotInTopLevel($expectedFilter);
     }
     $expectedData = array();
     foreach (TableServiceFunctionalTestData::$TEST_TABLE_NAMES as $s) {
         if (substr($s, 0, strlen($effectivePrefix)) == $effectivePrefix) {
             $fte = new FakeTableInfoEntry();
             $fte->TableName = $s;
             array_push($expectedData, $fte);
         }
     }
     if (!is_null($options->getNextTableName())) {
         $tmpExpectedData = array();
         $foundNext = false;
         foreach ($expectedData as $s) {
             if ($s == $options->getNextTableName()) {
                 $foundNext = true;
             }
             if (!$foundNext) {
                 continue;
             }
             if (substr($s, 0, strlen($effectivePrefix)) == $effectivePrefix) {
                 $fte = new FakeTableInfoEntry();
                 $fte->TableName = $s;
                 array_push($expectedData, $fte);
             }
         }
         $expectedData = $tmpExpectedData;
     }
     $expectedData = TableServiceFunctionalTestUtils::filterList($expectedFilter, $expectedData);
     $effectiveTop = is_null($options->getTop()) ? 100000 : $options->getTop();
     $expectedCount = min($effectiveTop, count($expectedData));
     $tables = $ret->getTables();
     for ($i = 0; $i < $expectedCount; $i++) {
         $expected = $expectedData[$i]->TableName;
         // Assume there are other tables. Make sure the expected ones are there.
         $foundNext = false;
         foreach ($tables as $actual) {
             if ($expected == $actual) {
                 $foundNext = true;
                 break;
             }
         }
         $this->assertTrue($foundNext, $expected . ' should be in getTables');
     }
 }