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; })); }
public function testAddFields() { $fields = array("title" => 'p.name', "_identifier_" => 'p.id'); $this->_datatable->setFields($fields); $this->_datatable->addFields(array('description' => 'p.description')); $this->assertEquals($fields + array('description' => 'p.description'), $this->_datatable->getFields()); }