WordPress.org

Make WordPress Core

Changeset 51668


Ignore:
Timestamp:
08/26/2021 04:50:02 PM (4 weeks ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/tests/phpunit/tests/functions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/functions/wpFilterObjectList.php

    r51665 r51668  
    1111    public $array_list  = array();
    1212
    13     function set_up() {
     13    public function set_up() {
    1414        parent::set_up();
    1515        $this->array_list['foo'] = array(
     
    4242    }
    4343
    44     function test_filter_object_list_and() {
     44    public function test_filter_object_list_and() {
    4545        $list = wp_filter_object_list(
    4646            $this->object_list,
     
    5656    }
    5757
    58     function test_filter_object_list_or() {
     58    public function test_filter_object_list_or() {
    5959        $list = wp_filter_object_list(
    6060            $this->object_list,
     
    7171    }
    7272
    73     function test_filter_object_list_not() {
     73    public function test_filter_object_list_not() {
    7474        $list = wp_filter_object_list(
    7575            $this->object_list,
     
    8484    }
    8585
    86     function test_filter_object_list_and_field() {
     86    public function test_filter_object_list_and_field() {
    8787        $list = wp_filter_object_list(
    8888            $this->object_list,
     
    103103    }
    104104
    105     function test_filter_object_list_or_field() {
     105    public function test_filter_object_list_or_field() {
    106106        $list = wp_filter_object_list(
    107107            $this->object_list,
     
    122122    }
    123123
    124     function test_filter_object_list_not_field() {
     124    public function test_filter_object_list_not_field() {
    125125        $list = wp_filter_object_list(
    126126            $this->object_list,
     
    135135    }
    136136
    137     function test_filter_object_list_nested_array_and() {
     137    public function test_filter_object_list_nested_array_and() {
    138138        $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND' );
    139139        $this->assertCount( 1, $list );
     
    141141    }
    142142
    143     function test_filter_object_list_nested_array_not() {
     143    public function test_filter_object_list_nested_array_not() {
    144144        $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'red' ) ), 'NOT' );
    145145        $this->assertCount( 2, $list );
     
    148148    }
    149149
    150     function test_filter_object_list_nested_array_or() {
     150    public function test_filter_object_list_nested_array_or() {
    151151        $list = wp_filter_object_list(
    152152            $this->object_list,
     
    162162    }
    163163
    164     function test_filter_object_list_nested_array_or_singular() {
     164    public function test_filter_object_list_nested_array_or_singular() {
    165165        $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'OR' );
    166166        $this->assertCount( 1, $list );
     
    168168    }
    169169
    170     function test_filter_object_list_nested_array_and_field() {
     170    public function test_filter_object_list_nested_array_and_field() {
    171171        $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND', 'name' );
    172172        $this->assertSame( array( 'baz' => 'baz' ), $list );
    173173    }
    174174
    175     function test_filter_object_list_nested_array_not_field() {
     175    public function test_filter_object_list_nested_array_not_field() {
    176176        $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'green' ) ), 'NOT', 'name' );
    177177        $this->assertSame(
     
    184184    }
    185185
    186     function test_filter_object_list_nested_array_or_field() {
     186    public function test_filter_object_list_nested_array_or_field() {
    187187        $list = wp_filter_object_list(
    188188            $this->object_list,
  • trunk/tests/phpunit/tests/functions/wpListPluck.php

    r51663 r51668  
    1111    public $array_list  = array();
    1212
    13     function set_up() {
     13    public function set_up() {
    1414        parent::set_up();
    1515        $this->array_list['foo'] = array(
     
    4242    }
    4343
    44     function test_wp_list_pluck_array_and_object() {
     44    public function test_wp_list_pluck_array_and_object() {
    4545        $list = wp_list_pluck( $this->object_list, 'name' );
    4646        $this->assertSame(
     
    6767     * @ticket 28666
    6868     */
    69     function test_wp_list_pluck_index_key() {
     69    public function test_wp_list_pluck_index_key() {
    7070        $list = wp_list_pluck( $this->array_list, 'name', 'id' );
    7171        $this->assertSame(
     
    8282     * @ticket 28666
    8383     */
    84     function test_wp_list_pluck_object_index_key() {
     84    public function test_wp_list_pluck_object_index_key() {
    8585        $list = wp_list_pluck( $this->object_list, 'name', 'id' );
    8686        $this->assertSame(
     
    9797     * @ticket 28666
    9898     */
    99     function test_wp_list_pluck_missing_index_key() {
     99    public function test_wp_list_pluck_missing_index_key() {
    100100        $list = wp_list_pluck( $this->array_list, 'name', 'nonexistent' );
    101101        $this->assertSame(
     
    112112     * @ticket 28666
    113113     */
    114     function test_wp_list_pluck_partial_missing_index_key() {
     114    public function test_wp_list_pluck_partial_missing_index_key() {
    115115        $array_list = $this->array_list;
    116116        unset( $array_list['bar']['id'] );
     
    129129     * @ticket 28666
    130130     */
    131     function test_wp_list_pluck_mixed_index_key() {
     131    public function test_wp_list_pluck_mixed_index_key() {
    132132        $mixed_list        = $this->array_list;
    133133        $mixed_list['bar'] = (object) $mixed_list['bar'];
     
    146146     * @ticket 16895
    147147     */
    148     function test_wp_list_pluck_containing_references() {
     148    public function test_wp_list_pluck_containing_references() {
    149149        $ref_list = array(
    150150            & $this->object_list['foo'],
     
    171171     * @ticket 16895
    172172     */
    173     function test_wp_list_pluck_containing_references_keys() {
     173    public function test_wp_list_pluck_containing_references_keys() {
    174174        $ref_list = array(
    175175            & $this->object_list['foo'],
Note: See TracChangeset for help on using the changeset viewer.