예제 #1
0
 /**
  * @covers MicrosoftAzure\Storage\Table\Models\Query::setSelectFields
  * @covers MicrosoftAzure\Storage\Table\Models\Query::getSelectFields
  */
 public function testSetSelectFields()
 {
     // Setup
     $query = new Query();
     $expected = array('customerId', 'customerName');
     // Test
     $query->setSelectFields($expected);
     // Assert
     $this->assertEquals($expected, $query->getSelectFields());
 }
 public function testCheckQuery()
 {
     $query = new Query();
     $this->assertNull($query->getFilter(), 'Default Query->getFilter');
     $this->assertNull($query->getSelectFields(), 'Default Query->getSelectFields');
     $this->assertNull($query->getTop(), 'Default Query->getTop');
     $query->addSelectField('bar');
     $query->addSelectField('baz');
     $this->assertNotNull($query->getSelectFields(), 'Add Query->getSelectFields');
     $this->assertEquals(2, count($query->getSelectFields()), 'Add Query->getSelectFields->size');
     $filter = Filter::applyConstant('foo', EdmType::STRING);
     $query->setFilter($filter);
     $query->setSelectFields(null);
     $query->setTop(TableServiceFunctionalTestData::INT_MAX_VALUE);
     $this->assertEquals($filter, $query->getFilter(), 'Set Query->getFilter');
     $this->assertNull($query->getSelectFields(), 'Set Query->getSelectFields');
     $this->assertEquals(TableServiceFunctionalTestData::INT_MAX_VALUE, $query->getTop(), 'Set Query->getTop');
 }