Coding Standards: Add missing visibility keywords for wp_filter_object_list() and wp_list_pluck() tests.

Follow-up to [51663-51667].

Props pbearne.
See #53363, #53987.

git-svn-id: https://develop.svn.wordpress.org/trunk@51668 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
SergeyBiryukov 2021-08-26 16:50:02 +00:00
parent 72de4966b8
commit d616b931e0
2 changed files with 23 additions and 23 deletions

View File

@ -10,7 +10,7 @@ class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
public $object_list = array();
public $array_list = array();
function set_up() {
public function set_up() {
parent::set_up();
$this->array_list['foo'] = array(
'name' => 'foo',
@ -41,7 +41,7 @@ class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
}
}
function test_filter_object_list_and() {
public function test_filter_object_list_and() {
$list = wp_filter_object_list(
$this->object_list,
array(
@ -55,7 +55,7 @@ class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
$this->assertArrayHasKey( 'bar', $list );
}
function test_filter_object_list_or() {
public function test_filter_object_list_or() {
$list = wp_filter_object_list(
$this->object_list,
array(
@ -70,7 +70,7 @@ class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
$this->assertArrayHasKey( 'baz', $list );
}
function test_filter_object_list_not() {
public function test_filter_object_list_not() {
$list = wp_filter_object_list(
$this->object_list,
array(
@ -83,7 +83,7 @@ class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
$this->assertArrayHasKey( 'baz', $list );
}
function test_filter_object_list_and_field() {
public function test_filter_object_list_and_field() {
$list = wp_filter_object_list(
$this->object_list,
array(
@ -102,7 +102,7 @@ class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
);
}
function test_filter_object_list_or_field() {
public function test_filter_object_list_or_field() {
$list = wp_filter_object_list(
$this->object_list,
array(
@ -121,7 +121,7 @@ class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
);
}
function test_filter_object_list_not_field() {
public function test_filter_object_list_not_field() {
$list = wp_filter_object_list(
$this->object_list,
array(
@ -134,20 +134,20 @@ class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
$this->assertSame( array( 'baz' => 'baz' ), $list );
}
function test_filter_object_list_nested_array_and() {
public function test_filter_object_list_nested_array_and() {
$list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND' );
$this->assertCount( 1, $list );
$this->assertArrayHasKey( 'baz', $list );
}
function test_filter_object_list_nested_array_not() {
public function test_filter_object_list_nested_array_not() {
$list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'red' ) ), 'NOT' );
$this->assertCount( 2, $list );
$this->assertArrayHasKey( 'bar', $list );
$this->assertArrayHasKey( 'baz', $list );
}
function test_filter_object_list_nested_array_or() {
public function test_filter_object_list_nested_array_or() {
$list = wp_filter_object_list(
$this->object_list,
array(
@ -161,18 +161,18 @@ class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
$this->assertArrayHasKey( 'baz', $list );
}
function test_filter_object_list_nested_array_or_singular() {
public function test_filter_object_list_nested_array_or_singular() {
$list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'OR' );
$this->assertCount( 1, $list );
$this->assertArrayHasKey( 'baz', $list );
}
function test_filter_object_list_nested_array_and_field() {
public function test_filter_object_list_nested_array_and_field() {
$list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND', 'name' );
$this->assertSame( array( 'baz' => 'baz' ), $list );
}
function test_filter_object_list_nested_array_not_field() {
public function test_filter_object_list_nested_array_not_field() {
$list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'green' ) ), 'NOT', 'name' );
$this->assertSame(
array(
@ -183,7 +183,7 @@ class Tests_Functions_wpFilterObjectList extends WP_UnitTestCase {
);
}
function test_filter_object_list_nested_array_or_field() {
public function test_filter_object_list_nested_array_or_field() {
$list = wp_filter_object_list(
$this->object_list,
array(

View File

@ -10,7 +10,7 @@ class Tests_Functions_wpListPluck extends WP_UnitTestCase {
public $object_list = array();
public $array_list = array();
function set_up() {
public function set_up() {
parent::set_up();
$this->array_list['foo'] = array(
'name' => 'foo',
@ -41,7 +41,7 @@ class Tests_Functions_wpListPluck extends WP_UnitTestCase {
}
}
function test_wp_list_pluck_array_and_object() {
public function test_wp_list_pluck_array_and_object() {
$list = wp_list_pluck( $this->object_list, 'name' );
$this->assertSame(
array(
@ -66,7 +66,7 @@ class Tests_Functions_wpListPluck extends WP_UnitTestCase {
/**
* @ticket 28666
*/
function test_wp_list_pluck_index_key() {
public function test_wp_list_pluck_index_key() {
$list = wp_list_pluck( $this->array_list, 'name', 'id' );
$this->assertSame(
array(
@ -81,7 +81,7 @@ class Tests_Functions_wpListPluck extends WP_UnitTestCase {
/**
* @ticket 28666
*/
function test_wp_list_pluck_object_index_key() {
public function test_wp_list_pluck_object_index_key() {
$list = wp_list_pluck( $this->object_list, 'name', 'id' );
$this->assertSame(
array(
@ -96,7 +96,7 @@ class Tests_Functions_wpListPluck extends WP_UnitTestCase {
/**
* @ticket 28666
*/
function test_wp_list_pluck_missing_index_key() {
public function test_wp_list_pluck_missing_index_key() {
$list = wp_list_pluck( $this->array_list, 'name', 'nonexistent' );
$this->assertSame(
array(
@ -111,7 +111,7 @@ class Tests_Functions_wpListPluck extends WP_UnitTestCase {
/**
* @ticket 28666
*/
function test_wp_list_pluck_partial_missing_index_key() {
public function test_wp_list_pluck_partial_missing_index_key() {
$array_list = $this->array_list;
unset( $array_list['bar']['id'] );
$list = wp_list_pluck( $array_list, 'name', 'id' );
@ -128,7 +128,7 @@ class Tests_Functions_wpListPluck extends WP_UnitTestCase {
/**
* @ticket 28666
*/
function test_wp_list_pluck_mixed_index_key() {
public function test_wp_list_pluck_mixed_index_key() {
$mixed_list = $this->array_list;
$mixed_list['bar'] = (object) $mixed_list['bar'];
$list = wp_list_pluck( $mixed_list, 'name', 'id' );
@ -145,7 +145,7 @@ class Tests_Functions_wpListPluck extends WP_UnitTestCase {
/**
* @ticket 16895
*/
function test_wp_list_pluck_containing_references() {
public function test_wp_list_pluck_containing_references() {
$ref_list = array(
& $this->object_list['foo'],
& $this->object_list['bar'],
@ -170,7 +170,7 @@ class Tests_Functions_wpListPluck extends WP_UnitTestCase {
/**
* @ticket 16895
*/
function test_wp_list_pluck_containing_references_keys() {
public function test_wp_list_pluck_containing_references_keys() {
$ref_list = array(
& $this->object_list['foo'],
& $this->object_list['bar'],