Ejemplo n.º 1
0
 public function test_render()
 {
     $sorting = new Sort(array('Column1' => ''));
     $sorting->set_order('ASC');
     //testing with checkbox column true
     $html = '<tr><th><input type="checkbox" onclick="$(\'.selected\').attr(\'checked\', this.checked);"/></th><th>Column1</th></tr>';
     $this->assertEquals($html, $sorting->render());
     //testing with checkbox column false
     $sorting->set_check_box_column(FALSE);
     $html = '<tr><th>Column1</th></tr>';
     $this->assertEquals($html, $sorting->render());
     //testing with attributes
     $sorting = new Sort(array('Column1' => array('sort' => '', 'attributes' => array('width' => 150))));
     $sorting->set_order('ASC');
     //testing with checkbox column true
     $html = '<tr><th><input type="checkbox" onclick="$(\'.selected\').attr(\'checked\', this.checked);"/></th><th width="150">Column1</th></tr>';
     $this->assertEquals($html, $sorting->render());
 }