From f6a0e4cf46ceee2cb536e84e290ca50163821f06 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Tue, 3 Jul 2012 11:34:35 +0530 Subject: [PATCH 1/6] Test for _getEditLink function in PMA_DisplayResults class --- test/classes/PMA_DisplayResults_test.php | 61 ++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index 39397cf475..f6fa594c67 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -640,7 +640,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Data provider for testGetCheckBoxesForMultipleRowOperations * - * return array parameters and output + * @return array parameters and output */ public function dataProviderForGetCheckBoxesForMultipleRowOperations() { @@ -778,7 +778,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Data provider for testGetSortParamsCase1 * - * return array parameters and output + * @return array parameters and output */ public function dataProviderForGetSortParamsCase1() { @@ -808,7 +808,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Data provider for testGetSortParamsCase2 * - * return array parameters and output + * @return array parameters and output */ public function dataProviderForGetSortParamsCase2() { @@ -845,7 +845,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Data provider for testGetCheckboxForMultiRowSubmissions * - * return array parameters and output + * @return array parameters and output */ public function dataProviderForGetCheckboxForMultiRowSubmissions() { @@ -886,6 +886,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param string $id_suffix suffix for the id * @param string $class css classes for the td element * @param string $output output of _getSortParams + * @param string $output output of _getCheckboxForMultiRowSubmissions * * @dataProvider dataProviderForGetCheckboxForMultiRowSubmissions */ @@ -905,5 +906,57 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ); } + /** + * Data provider for testGetEditLink + * + * @return array parametres and output + */ + public function dataProviderForGetEditLink() + { + return array( + array( + 'tbl_change.php?db=Data&table=customer&where_clause=%60customer%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60customer%60&goto=sql.php&default_action=update&token=bbd5003198a3bd856b21d9607d6c6a1e', + 'odd edit_row_anchor row_0 vpointer vmarker', + 'Edit Edit', + '`customer`.`id` = 1', + '%60customer%60.%60id%60+%3D+1', + ' +Edit Edit +' + ) + ); + } + + /** + * Test for _getEditLink + * + * @param string $edit_url edit url + * @param string $class css classes for td element + * @param string $edit_str text for the edit link + * @param string $where_clause where clause + * @param string $where_clause_html url encoded where clause + * @param string $output _getEditLink + * + * @dataProvider dataProviderForGetEditLink + */ + public function testGetEditLink( + $edit_url, $class, $edit_str, $where_clause, $where_clause_html, $output + ) { + + $GLOBALS['cfg']['PropertiesIconic'] = 'both'; + $GLOBALS['cfg']['LinkLengthLimit'] = 1000; + + $this->assertEquals( + $this->_callPrivateFunction( + '_getEditLink', + array( + $edit_url, $class, $edit_str, $where_clause, $where_clause_html + ) + ), + $output + ); + + } + } From a4b02c26e6573ae5de9277aec2d253ae8b946913 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Tue, 3 Jul 2012 12:32:21 +0530 Subject: [PATCH 2/6] Test for _getCopyLink function in PMA_DisplayResults class --- test/classes/PMA_DisplayResults_test.php | 53 +++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index f6fa594c67..7acf64e230 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -935,7 +935,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param string $edit_str text for the edit link * @param string $where_clause where clause * @param string $where_clause_html url encoded where clause - * @param string $output _getEditLink + * @param string $output output of _getEditLink * * @dataProvider dataProviderForGetEditLink */ @@ -958,5 +958,56 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase } + /** + * Data provider for testGetCopyLink + * + * @return array parameters and output + */ + public function dataProviderForGetCopyLink() + { + return array( + array( + 'tbl_change.php?db=Data&table=customer&where_clause=%60customer%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60customer%60&goto=sql.php&default_action=insert&token=f597309d3a066c3c81a6cb015a79636d', + 'Copy Copy', + '`customer`.`id` = 1', + '%60customer%60.%60id%60+%3D+1', + 'odd row_0 vpointer vmarker', + ' +Copy Copy +' + ) + ); + } + + /** + * Test for _getCopyLink + * + * @param string $copy_url copy url + * @param string $copy_str text for the copy link + * @param string $where_clause where clause + * @param string $where_clause_html url encoded where clause + * @param string $class css classes for the td element + * @param string $output output of _getCopyLink + * + * @dataProvider dataProviderForGetCopyLink + */ + public function testGetCopyLink( + $copy_url, $copy_str, $where_clause, $where_clause_html, $class, $output + ) { + + $GLOBALS['cfg']['PropertiesIconic'] = 'both'; + $GLOBALS['cfg']['LinkLengthLimit'] = 1000; + + $this->assertEquals( + $this->_callPrivateFunction( + '_getCopyLink', + array( + $copy_url, $copy_str, $where_clause, $where_clause_html, $class + ) + ), + $output + ); + } + } From c35dd10750a14edaae8291342521aa91da90ffe8 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Tue, 3 Jul 2012 12:44:24 +0530 Subject: [PATCH 3/6] Test for _getDeleteLink function in PMA_DisplayResults class --- test/classes/PMA_DisplayResults_test.php | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index 7acf64e230..ca8afa0888 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -12,6 +12,7 @@ require_once 'libraries/DisplayResults.class.php'; require_once 'libraries/url_generating.lib.php'; require_once 'libraries/php-gettext/gettext.inc'; require_once 'libraries/CommonFunctions.class.php'; +require_once 'libraries/js_escape.lib.php'; class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase @@ -1009,5 +1010,54 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ); } + /** + * Data provider for testGetDeleteLink + * + * @return array parameters and output + */ + public function dataProviderForGetDeleteLink() + { + return array( + array( + 'sql.php?db=Data&table=customer&sql_query=DELETE+FROM+%60Data%60.%60customer%60+WHERE+%60customer%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&goto=sql.php%3Fdb%3DData%26table%3Dcustomer%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560customer%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Df597309d3a066c3c81a6cb015a79636d&token=f597309d3a066c3c81a6cb015a79636d', + 'Delete Delete', + 'DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1', + 'odd row_0 vpointer vmarker', + ' +Delete Delete +' + ) + ); + } + + /** + * Test for _getDeleteLink + * + * @param string $del_url delete url + * @param string $del_str text for the delete link + * @param string $js_conf text for the JS confirmation + * @param string $class css classes for the td element + * @param string $output output of _getDeleteLink + * + * @dataProvider dataProviderForGetDeleteLink + */ + public function testGetDeleteLink( + $del_url, $del_str, $js_conf, $class, $output + ) { + + $GLOBALS['cfg']['PropertiesIconic'] = 'both'; + $GLOBALS['cfg']['LinkLengthLimit'] = 1000; + + $this->assertEquals( + $this->_callPrivateFunction( + '_getDeleteLink', + array( + $del_url, $del_str, $js_conf, $class + ) + ), + $output + ); + } + } From 68ddeb300873019ede8384d66a0e862fd51092b0 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Tue, 3 Jul 2012 13:26:46 +0530 Subject: [PATCH 4/6] Test for _getCheckboxAndLinks function in PMA_DisplayResults class --- test/classes/PMA_DisplayResults_test.php | 267 +++++++++++++++++++++++ 1 file changed, 267 insertions(+) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index ca8afa0888..4912d357c3 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -1059,5 +1059,272 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ); } + /** + * Data provider for testGetCheckboxAndLinksCase1 + * + * @return array parameters and output + */ + public function dataProviderForGetCheckboxAndLinksCase1() + { + return array( + array( + PMA_DisplayResults::POSITION_LEFT, + 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&token=ae4c6d18375f446dfa068420c1f6a4e8', + array( + 'edit_lnk' => 'ur', + 'del_lnk' => 'dr', + 'sort_lnk' => '0', + 'nav_bar' => '1', + 'ins_row' => '1', + 'bkm_form' => '1', + 'text_btn' => '1', + 'pview_lnk' => '1' + ), + 0, + '`new`.`id` = 1', + '%60new%60.%60id%60+%3D+1', + array( + '`new`.`id`' => '= 1', + ), + 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', + 'l', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=update&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=insert&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'edit_row_anchor', + 'Edit Edit', + 'Copy Copy', + 'Delete Delete', + 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', + ' +Edit Edit + +Copy Copy + +Delete Delete +' + ) + ); + } + + /** + * Test for _getCheckboxAndLinks - case 1 + * + * @param string $position the position of the checkbox and links + * @param string $del_url delete url + * @param array $is_display array with explicit indexes for all the + * display elements + * @param string $row_no row number + * @param string $where_clause where clause + * @param string $where_clause_html url encoded where clause + * @param array $condition_array array of conditions in the where clause + * @param string $del_query delete query + * @param string $id_suffix suffix for the id + * @param string $edit_url edit url + * @param string $copy_url copy url + * @param string $class css classes for the td elements + * @param string $edit_str text for the edit link + * @param string $copy_str text for the copy link + * @param string $del_str text for the delete link + * @param string $js_conf text for the JS confirmation + * @param string $output output of _getCheckboxAndLinks + * + * @dataProvider dataProviderForGetCheckboxAndLinksCase1 + */ + public function testGetCheckboxAndLinksCase1( + $position, $del_url, $is_display, $row_no, $where_clause, + $where_clause_html, $condition_array, $del_query, $id_suffix, $edit_url, + $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf, $output + ) { + + $this->assertEquals( + $this->_callPrivateFunction( + '_getCheckboxAndLinks', + array( + $position, $del_url, $is_display, $row_no, $where_clause, + $where_clause_html, $condition_array, $del_query, + $id_suffix, $edit_url, $copy_url, $class, $edit_str, + $copy_str, $del_str, $js_conf + ) + ), + $output + ); + } + + /** + * Data provider for testGetCheckboxAndLinksCase2 + * + * @return array parameters and output + */ + public function dataProviderForGetCheckboxAndLinksCase2() + { + return array( + array( + PMA_DisplayResults::POSITION_RIGHT, + 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&token=ae4c6d18375f446dfa068420c1f6a4e8', + array( + 'edit_lnk' => 'ur', + 'del_lnk' => 'dr', + 'sort_lnk' => '0', + 'nav_bar' => '1', + 'ins_row' => '1', + 'bkm_form' => '1', + 'text_btn' => '1', + 'pview_lnk' => '1' + ), + 0, + '`new`.`id` = 1', + '%60new%60.%60id%60+%3D+1', + array( + '`new`.`id`' => '= 1', + ), + 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', + 'l', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=update&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=insert&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'edit_row_anchor', + 'Edit Edit', + 'Copy Copy', + 'Delete Delete', + 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', + ' +Delete Delete + +Copy Copy + +Edit Edit + ' + ) + ); + } + + /** + * Test for _getCheckboxAndLinks - case 2 + * + * @param string $position the position of the checkbox and links + * @param string $del_url delete url + * @param array $is_display array with explicit indexes for all the + * display elements + * @param string $row_no row number + * @param string $where_clause where clause + * @param string $where_clause_html url encoded where clause + * @param array $condition_array array of conditions in the where clause + * @param string $del_query delete query + * @param string $id_suffix suffix for the id + * @param string $edit_url edit url + * @param string $copy_url copy url + * @param string $class css classes for the td elements + * @param string $edit_str text for the edit link + * @param string $copy_str text for the copy link + * @param string $del_str text for the delete link + * @param string $js_conf text for the JS confirmation + * @param string $output output of _getCheckboxAndLinks + * + * @dataProvider dataProviderForGetCheckboxAndLinksCase2 + */ + public function testGetCheckboxAndLinksCase2( + $position, $del_url, $is_display, $row_no, $where_clause, + $where_clause_html, $condition_array, $del_query, $id_suffix, $edit_url, + $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf, $output + ) { + + $this->assertEquals( + $this->_callPrivateFunction( + '_getCheckboxAndLinks', + array( + $position, $del_url, $is_display, $row_no, $where_clause, + $where_clause_html, $condition_array, $del_query, + $id_suffix, $edit_url, $copy_url, $class, $edit_str, + $copy_str, $del_str, $js_conf + ) + ), + $output + ); + } + + /** + * Data provider for testGetCheckboxAndLinksCase3 + * + * @return array parameters and output + */ + public function dataProviderForGetCheckboxAndLinksCase3() + { + return array( + array( + PMA_DisplayResults::POSITION_NONE, + 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&token=ae4c6d18375f446dfa068420c1f6a4e8', + array( + 'edit_lnk' => 'ur', + 'del_lnk' => 'dr', + 'sort_lnk' => '0', + 'nav_bar' => '1', + 'ins_row' => '1', + 'bkm_form' => '1', + 'text_btn' => '1', + 'pview_lnk' => '1' + ), + 0, + '`new`.`id` = 1', + '%60new%60.%60id%60+%3D+1', + array( + '`new`.`id`' => '= 1', + ), + 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', + 'l', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=update&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=insert&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'edit_row_anchor', + 'Edit Edit', + 'Copy Copy', + 'Delete Delete', + 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', + ' ' + ) + ); + } + + /** + * Test for _getCheckboxAndLinks - case 3 + * + * @param string $position the position of the checkbox and links + * @param string $del_url delete url + * @param array $is_display array with explicit indexes for all the + * display elements + * @param string $row_no row number + * @param string $where_clause where clause + * @param string $where_clause_html url encoded where clause + * @param array $condition_array array of conditions in the where clause + * @param string $del_query delete query + * @param string $id_suffix suffix for the id + * @param string $edit_url edit url + * @param string $copy_url copy url + * @param string $class css classes for the td elements + * @param string $edit_str text for the edit link + * @param string $copy_str text for the copy link + * @param string $del_str text for the delete link + * @param string $js_conf text for the JS confirmation + * @param string $output output of _getCheckboxAndLinks + * + * @dataProvider dataProviderForGetCheckboxAndLinksCase3 + */ + public function testGetCheckboxAndLinksCase3( + $position, $del_url, $is_display, $row_no, $where_clause, + $where_clause_html, $condition_array, $del_query, $id_suffix, $edit_url, + $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf, $output + ) { + + $this->assertEquals( + $this->_callPrivateFunction( + '_getCheckboxAndLinks', + array( + $position, $del_url, $is_display, $row_no, $where_clause, + $where_clause_html, $condition_array, $del_query, + $id_suffix, $edit_url, $copy_url, $class, $edit_str, + $copy_str, $del_str, $js_conf + ) + ), + $output + ); + } + } From d357356e45ab887c7eb301f62f43bf74567bb6d5 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Tue, 3 Jul 2012 20:37:47 +0530 Subject: [PATCH 5/6] Test for _mimeDefaultFunction function in PMA_DisplayResults class --- test/classes/PMA_DisplayResults_test.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index 4912d357c3..feb0da32dd 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -1326,5 +1326,19 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ); } + /** + * Test for _mimeDefaultFunction + */ + public function testMimeDefaultFunction() + { + $this->assertEquals( + $this->_callPrivateFunction( + '_mimeDefaultFunction', + array("A 'quote' is bold") + ), + "A 'quote' is <b>bold</b>" + ); + } + } From 1c245c06f3adcf76d216cd763ca656e2458a0492 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Tue, 3 Jul 2012 20:41:13 +0530 Subject: [PATCH 6/6] Test for _getPlacedLinks function in PMA_DisplayResults class --- test/classes/PMA_DisplayResults_test.php | 85 +++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index feb0da32dd..12bb7127b2 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -1338,7 +1338,90 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ), "A 'quote' is <b>bold</b>" ); - } + } + + /** + * Data provider for testGetPlacedLinks + * + * @return array parameters and output + */ + public function dataProviderForGetPlacedLinks() + { + return array( + array( + PMA_DisplayResults::POSITION_NONE, + 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&token=ae4c6d18375f446dfa068420c1f6a4e8', + array( + 'edit_lnk' => 'ur', + 'del_lnk' => 'dr', + 'sort_lnk' => '0', + 'nav_bar' => '1', + 'ins_row' => '1', + 'bkm_form' => '1', + 'text_btn' => '1', + 'pview_lnk' => '1' + ), + 0, + '`new`.`id` = 1', + '%60new%60.%60id%60+%3D+1', + array( + '`new`.`id`' => '= 1', + ), + 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', + 'l', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=update&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=insert&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'edit_row_anchor', + 'Edit Edit', + 'Copy Copy', + 'Delete Delete', + null, + ' ' + ) + ); + } + + /** + * Test for _getPlacedLinks + * + * @param string $dir the direction of links should place + * @param string $del_url the url for delete row + * @param array $is_display which elements to display + * @param integer $row_no the index of current row + * @param string $where_clause the where clause of the sql + * @param string $where_clause_html the html encoded where clause + * @param array $condition_array array of keys (primary, unique, condition) + * @param string $del_query the query for delete row + * @param string $dir_letter the letter denoted the direction + * @param string $edit_url the url for edit row + * @param string $copy_url the url for copy row + * @param string $edit_anchor_class the class for html element for edit + * @param string $edit_str the label for edit row + * @param string $copy_str the label for copy row + * @param string $del_str the label for delete row + * @param string $js_conf text for the JS confirmation + * @param string $output output of _getPlacedLinks + * + * @dataProvider dataProviderForGetPlacedLinks + */ + public function testGetPlacedLinks( + $dir, $del_url, $is_display, $row_no, $where_clause, $where_clause_html, + $condition_array, $del_query, $dir_letter, $edit_url, $copy_url, + $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf, $output + ) { + $this->assertEquals( + $this->_callPrivateFunction( + '_getPlacedLinks', + array( + $dir, $del_url, $is_display, $row_no, $where_clause, + $where_clause_html, $condition_array, $del_query, + $dir_letter, $edit_url, $copy_url, $edit_anchor_class, + $edit_str, $copy_str, $del_str, $js_conf + ) + ), + $output + ); + } }