123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <?php
- require_once api_get_path(LIBRARY_PATH).'sortable_table.class.php';
- require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
- class TestSortableTable extends UnitTestCase {
- public function __construct() {
- $this->UnitTestCase('Sortabletable library - main/inc/lib/sortable_table.class.test.php');
- }
- function testdisplay() {
- $instancia = new SortableTable();
- global $charset;
- ob_start();
- $res=$instancia->display();
- $this->assertTrue(is_null($res));
- ob_end_clean();
- //var_dump($res);
- }
- function testfilter_data() {
- $instancia = new SortableTable();
- $row=array();
- $res=$instancia->filter_data($row);
- $this->assertTrue(is_array($res));
- //var_dump($res);
- }
- function testget_additional_url_paramstring() {
- $instancia = new SortableTable();
- $res=$instancia->get_additional_url_paramstring();
- $this->assertTrue(is_string($res));
- //var_dump($res);
- }
- function testget_navigation_html() {
- $instancia = new SortableTable();
- $res=$instancia->get_navigation_html();
- $this->assertTrue(is_string($res));
- //var_dump($res);
- }
- function testget_page_select_form() {
- $instancia = new SortableTable();
- $res=$instancia->get_page_select_form();
- $this->assertTrue(is_string($res));
- //var_dump($res);
- }
- function testget_pager() {
- $instancia = new SortableTable();
- $res=$instancia->get_pager();
- $this->assertTrue(is_object($res));
- //var_dump($res);
- }
- function testget_sortable_table_param_string() {
- $instancia = new SortableTable();
- $res=$instancia->get_sortable_table_param_string();
- $this->assertTrue(is_string($res));
- //var_dump($res);
- }
- function testget_table_data() {
- $instancia = new SortableTable();
- $res=$instancia->get_table_data();
- $this->assertTrue(is_array($res));
- //var_dump($res);
- }
- function testget_table_html() {
- $instancia = new SortableTable();
- $res=$instancia->get_table_html();
- $this->assertTrue(is_string($res));
- //var_dump($res);
- }
- function testget_table_title() {
- $instancia = new SortableTable();
- $res=$instancia->get_table_title();
- $this->assertTrue(is_string($res));
- //var_dump($res);
- }
- function testget_total_number_of_items() {
- $instancia = new SortableTable();
- $res=$instancia->get_total_number_of_items();
- $this->assertTrue(is_numeric($res));
- //var_dump($res);
- }
- function testset_additional_parameters() {
- $instancia = new SortableTable();
- $parameters='';
- $res=$instancia->set_additional_parameters($parameters);
- $this->assertTrue(is_null($res));
- //var_dump($res);
- }
- function testset_column_filter() {
- $instancia = new SortableTable();
- $column='';
- $function='';
- $res=$instancia->set_column_filter($column, $function);
- $this->assertTrue(is_null($res));
- //var_dump($res);
- }
- function testset_form_actions() {
- $instancia = new SortableTable();
- $actions='';
- $checkbox_name = 'id';
- $res=$instancia->set_form_actions($actions, $checkbox_name = 'id');
- $this->assertTrue(is_null($res));
- //var_dump($res);
- }
- function testset_header() {
- $instancia = new SortableTable();
- $column='';
- $label='';
- $res=$instancia->set_header($column, $label, $sortable = true, $th_attributes = null, $td_attributes = null);
- $this->assertTrue(is_null($res));
- //var_dump($res);
- }
- function testset_other_tables() {
- $instancia = new SortableTable();
- $tablenames='';
- $res=$instancia->set_other_tables($tablenames);
- $this->assertTrue(is_null($res));
- //var_dump($res);
- }
- }
- class TestSortableTableFromArray extends UnitTestCase {
- function testget_table_data() {
- $res=SortableTableFromArray::get_table_data($from=1);
- $this->assertTrue(is_array($res));
- //var_dump($res);
- }
- function testget_total_number_of_items() {
- $res=SortableTableFromArray::get_total_number_of_items();
- $this->assertTrue(is_numeric($res));
- //var_dump($res);
- }
- }
- class TestSortableTableFromArrayConfig extends UnitTestCase {
- public function testget_table_data() {
- $res=SortableTableFromArray::get_table_data($from=1);
- $this->assertTrue(is_array($res));
- //var_dump($res);
- }
- public function testget_total_number_of_items() {
- $res=SortableTableFromArray::get_total_number_of_items();
- $this->assertTrue(is_numeric($res));
- //var_dump($res);
- }
- }
- ?>
|