/**
  * @dataProvider getSortParameterMappings
  */
 public function testSortByCreatesQueryWithSortParameter($order, $queryValue)
 {
     $builder = new RecordQueryBuilder();
     $builder->sortBy($order, true);
     $this->assertArraySubset(array('sort' => $queryValue, 'ord' => 'desc'), $builder->getQuery()->getRawQuery());
     $builder->sortBy($order, false);
     $this->assertArraySubset(array('sort' => $queryValue, 'ord' => 'asc'), $builder->getQuery()->getRawQuery());
 }
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testInvalidSortParameterThrowsException()
 {
     $builder = new RecordQueryBuilder();
     $builder->sortBy('test', true);
 }