예제 #1
0
 public function test_chainingClassBehavior()
 {
     $this->assertInstanceOf('\\Ali\\DatatableBundle\\Util\\Datatable', $this->_datatable->setEntity('$entity_name', '$entity_alias'));
     $this->assertInstanceOf('\\Ali\\DatatableBundle\\Util\\Datatable', $this->_datatable->setFields(array()));
     $this->assertInstanceOf('\\Ali\\DatatableBundle\\Util\\Datatable', $this->_datatable->setFixedData('$data'));
     $this->assertInstanceOf('\\Ali\\DatatableBundle\\Util\\Datatable', $this->_datatable->setHasAction(TRUE));
     $this->assertInstanceOf('\\Ali\\DatatableBundle\\Util\\Datatable', $this->_datatable->setOrder('$order_field', '$order_type'));
     $this->assertInstanceOf('\\Ali\\DatatableBundle\\Util\\Datatable', $this->_datatable->setRenderer(function ($value, $key) {
         return true;
     }));
 }
예제 #2
0
 public function testSetOrder()
 {
     $this->_datatable->setOrder('p.id', 'asc');
     $this->assertEquals('p.id', $this->_datatable->getOrderField());
     $this->assertEquals('asc', $this->_datatable->getOrderType());
 }