Пример #1
0
 /**
  * @covers ::__construct
  * @covers ::getDirection
  * @covers ::getParameters
  */
 public function testConstruct()
 {
     $direction = new SQL\Direction('name', 'DESC');
     $this->assertEquals('name', $direction->getContent());
     $this->assertEquals('DESC', $direction->getDirection());
     $this->assertNull($direction->getParameters());
     $sql = new SQL\SQL('test ?', array('test'));
     $direction = new SQL\Direction($sql, 'DESC');
     $this->assertSame($sql, $direction->getContent());
     $this->assertSame(array('test'), $direction->getParameters());
     $this->assertEquals('DESC', $direction->getDirection());
 }
Пример #2
0
 /**
  * Render a Direction object
  *
  * @param  SQL\Direction $item
  * @return string
  */
 public static function render(SQL\Direction $item)
 {
     return Compiler::expression(array(Compiler::name($item->getContent()), $item->getDirection()));
 }