diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index 8e07618c85..a4851c869f 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -637,5 +637,118 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ); } + /** + * Data provider for _getCheckBoxesForMultipleRowOperations + * + * return array parameters and output + */ + public function dataProviderForGetCheckBoxesForMultipleRowOperations() + { + return array( + array( + array( + 'emptypre' => 4, + 'emptyafter' => 0, + 'textbtn' => '\n \n \n', + 'desc' => array( + '\n\nid\n \n', + '\n\ncars_id\n \n', + '\n\ncustomer_id Ascending Descending array( + '\nEdit Edit\n\nEdit Edit\n\nEdit Edit\n\nEdit Edit\n array( + '\nCopy Copy\n\nCopy Copy\n\nCopy Copy\n\nCopy Copy\n array( + '\n\n\n\n array( + array( + '2\n', + '6\n', + '1\n' + ), + array( + '3\n', + '7\n', + '2\n' + ), + array( + '1\n', + '9\n', + '3\n' + ), + array( + '4\n', + '8\n', + '5\n' + ) + ), + 'row_delete' => array( + ' ', + ' ', + ' ', + ' ' + ), + 'rowdata' => array( + array( + '2\n', + '3\n', + '1\n', + '4\n' + ), + array( + '6\n', + '7\n', + '9\n', + '8\n' + ), + array( + '1\n', + '2\n', + '3\n', + '5\n' + ) + ) + ), + '_left', + ' ' + ) + ); + } + + /** + * Test for _getCheckBoxesForMultipleRowOperations + * + * @param array $vertical_display the information to display + * @param string $dir _left / _right + * @param string $output output of _getCheckBoxesForMultipleRowOperations + * + * @dataProvider dataProviderForGetCheckBoxesForMultipleRowOperations + */ + public function testGetCheckBoxesForMultipleRowOperations( + $vertical_display, $dir, $output + ) { + $_SESSION['tmp_user_values']['repeat_cells'] = 0; + $this->assertEquals( + $this->_callPrivateFunction( + '_getCheckBoxesForMultipleRowOperations', + array($vertical_display, $dir) + ), + $output + ); + } + }