Esempio n. 1
0
 /**
  * Setter and getter test
  */
 public function testSetterGetter()
 {
     $table = new Table();
     $this->assertContains('dataTable_', $table->getTableId());
     $table->setTableId('my_table_id');
     $this->assertContains('my_table_id', $table->getTableId());
 }
Esempio n. 2
0
 /**
  * Render test
  */
 public function testRenderAndToString()
 {
     $table = new Table();
     $needleTableTag = sprintf('<table id="%s" class="dataTable display">', $table->getTableId());
     $needleTableJsSelector = sprintf("\$('#%s').dataTable({", $table->getTableId());
     $this->assertContains($needleTableTag, $table->render());
     $this->assertContains($needleTableJsSelector, $table->render());
     $this->assertContains($needleTableJsSelector, (string) $table);
 }