Skip to content

Commit

Permalink
Updating unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajinsharwar committed May 26, 2024
1 parent 653290f commit 7240123
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/phpunit/tests/admin/wpListTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,10 @@ public function data_compat_fields() {
*
*/
public function test_search_box_working_with_array_of_orderby() {
$_REQUEST['s'] = 'search term';
$_REQUEST['orderby'] = array( 'menu_order' => 'ASC', 'title' => 'ASC' );

Check failure on line 533 in tests/phpunit/tests/admin/wpListTable.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

When a multi-item array uses associative keys, each value should start on a new line.

$user = self::factory()->user->create( array( 'role' => 'administrator' ) );
wp_set_current_user( $user );

$output = wp_safe_remote_get( get_admin_url( 'edit.php?post_type=page&orderby%5Bmenu_order%5D=ASC&orderby%5Btitle%5D=ASC' ));
$output = $output[ 'body' ];
$output = get_echo( array( $this->list_table, 'search_box' ), array( 'foo Label', 59494 ) );

$expected_html1 = '<input type="hidden" name="orderby[menu_order]" value="ASC" />';
$expected_html2 = '<input type="hidden" name="orderby[title]" value="ASC" />';
Expand Down

0 comments on commit 7240123

Please sign in to comment.