Ejemplo n.º 1
0
 /**
  * @dataProvider instanceProvider
  *
  * @since 1.0
  *
  * @param SortExpression $expression
  */
 public function testReturnValueOfGetDirection(SortExpression $expression)
 {
     $direction = $expression->getDirection();
     $this->assertInternalType('string', $direction);
     $this->assertTrue(in_array($direction, array(SortExpression::DIRECTION_ASCENDING, SortExpression::DIRECTION_DESCENDING)), 'Sort direction is one of the known values');
 }
 protected function getSerializedSortExpression(SortExpression $expression)
 {
     $valueArray = array('direction' => $expression->getDirection());
     $valueArray = array_merge($valueArray, $this->getExpressionValueSerialization($expression));
     return array('objectType' => 'sortExpression', 'sortExpressionType' => $expression->getType(), 'value' => $valueArray);
 }