/** * @test */ public function itShouldThrowExceptionIfDirectionNotValid() { $column = new Column('registration_date', 'user'); $order = new OrderBy($column, OrderBy::ASC); $this->setExpectedException('\\InvalidArgumentException'); $order->setDirection('this is not a valid direction'); }
/** * @param OrderBy $orderBy * * @return string */ public function writeOrderBy(OrderBy $orderBy) { $column = $this->columnWriter->writeColumn($orderBy->getColumn()); return $column . ' ' . $orderBy->getDirection(); }