Skip to content

Commit

Permalink
Another duplicated testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Jan 11, 2013
1 parent c20a83d commit dc3dcee
Showing 1 changed file with 9 additions and 121 deletions.
130 changes: 9 additions & 121 deletions test/classes/PMA_DisplayResults_test.php
Expand Up @@ -717,7 +717,7 @@ public function dataProviderForGetSortParams()
}

/**
* Test for _getSortParams - case 1
* Test for _getSortParams
*
* @param string $order_by_clause the order by clause of the sql query
* @param string $output output of _getSortParams
Expand Down Expand Up @@ -956,11 +956,11 @@ public function testGetDeleteLink(
}

/**
* Data provider for testGetCheckboxAndLinksCase1
* Data provider for testGetCheckboxAndLinks
*
* @return array parameters and output
*/
public function dataProviderForGetCheckboxAndLinksCase1()
public function dataProviderForGetCheckboxAndLinks()
{
return array(
array(
Expand Down Expand Up @@ -998,63 +998,7 @@ public function dataProviderForGetCheckboxAndLinksCase1()
<input type="hidden" class="where_clause" value="%60new%60.%60id%60+%3D+1" /></span></td><td class="center" >
<a href="sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;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&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" class="delete_row"><span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span></a>
<div class="hide">DELETE FROM `data`.`new` WHERE `new`.`id` = 1</div></td>'
)
);
}

/**
* 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
*
* @return void
*
* @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(
$output,
$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
)
)
);
}

/**
* Data provider for testGetCheckboxAndLinksCase2
*
* @return array parameters and output
*/
public function dataProviderForGetCheckboxAndLinksCase2()
{
return array(
),
array(
PMA_DisplayResults::POSITION_RIGHT,
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;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&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
Expand Down Expand Up @@ -1090,63 +1034,7 @@ public function dataProviderForGetCheckboxAndLinksCase2()
<input type="hidden" class="where_clause" value="%60new%60.%60id%60+%3D+1" /></span></td><td class="edit_row_anchor center" ><span class="nowrap">
<a href="tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=update&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span></a>
<input type="hidden" class="where_clause" value ="%60new%60.%60id%60+%3D+1" /></span></td><td class="center"><input type="checkbox" id="id_rows_to_delete0_right" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{&quot;`new`.`id`&quot;:&quot;= 1&quot;}" /> </td>'
)
);
}

/**
* 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
*
* @return void
*
* @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(
$output,
$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
)
)
);
}

/**
* Data provider for testGetCheckboxAndLinksCase3
*
* @return array parameters and output
*/
public function dataProviderForGetCheckboxAndLinksCase3()
{
return array(
),
array(
PMA_DisplayResults::POSITION_NONE,
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;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&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
Expand Down Expand Up @@ -1176,12 +1064,12 @@ public function dataProviderForGetCheckboxAndLinksCase3()
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{&quot;`new`.`id`&quot;:&quot;= 1&quot;}" /> </td>'
)
),
);
}

/**
* Test for _getCheckboxAndLinks - case 3
* Test for _getCheckboxAndLinks
*
* @param string $position the position of the checkbox and links
* @param string $del_url delete url
Expand All @@ -1204,9 +1092,9 @@ public function dataProviderForGetCheckboxAndLinksCase3()
*
* @return void
*
* @dataProvider dataProviderForGetCheckboxAndLinksCase3
* @dataProvider dataProviderForGetCheckboxAndLinks
*/
public function testGetCheckboxAndLinksCase3(
public function testGetCheckboxAndLinks(
$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
Expand Down

0 comments on commit dc3dcee

Please sign in to comment.