Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (3 years ago)
Author:
hellofromTonya
Message:

Coding Standards: Add visibility to methods in tests/phpunit/tests/.

Adds a public visibility to test fixtures, tests, data providers, and callbacks methods.

Adds a private visibility to helper methods within test classes.

Renames callbacks and helpers that previously started with a _ prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit.

Props costdev, jrf, hellofromTonya.
Fixes #54177.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/query.php

    r51462 r52010  
    99     * @group taxonomy
    1010     */
    11     function test_category__and_var() {
     11    public function test_category__and_var() {
    1212        $q = new WP_Query();
    1313
     
    5151     * @group taxonomy
    5252     */
    53     function test_empty_category__in() {
     53    public function test_empty_category__in() {
    5454        $cat_id  = self::factory()->category->create();
    5555        $post_id = self::factory()->post->create();
     
    8080     * @ticket 22448
    8181     */
    82     function test_the_posts_filter() {
     82    public function test_the_posts_filter() {
    8383        // Create posts and clear their caches.
    8484        $post_ids = self::factory()->post->create_many( 4 );
     
    118118     * Use with the_posts filter, appends a post and adds some custom data.
    119119     */
    120     function the_posts_filter( $posts ) {
     120    public function the_posts_filter( $posts ) {
    121121        $posts[] = clone $posts[0];
    122122
     
    129129    }
    130130
    131     function test_post__in_ordering() {
     131    public function test_post__in_ordering() {
    132132        $post_id1 = self::factory()->post->create(
    133133            array(
     
    211211    }
    212212
    213     function test_post__in_attachment_ordering() {
     213    public function test_post__in_attachment_ordering() {
    214214        $post_id    = self::factory()->post->create();
    215215        $att_ids    = array();
     
    309309    }
    310310
    311     function test_post_status() {
     311    public function test_post_status() {
    312312        $statuses1 = get_post_stati();
    313313        $this->assertContains( 'auto-draft', $statuses1 );
     
    332332     * @ticket 17065
    333333     */
    334     function test_orderby_array() {
     334    public function test_orderby_array() {
    335335        global $wpdb;
    336336
     
    368368     * @ticket 17065
    369369     */
    370     function test_order() {
     370    public function test_order() {
    371371        global $wpdb;
    372372
     
    408408     * @ticket 29629
    409409     */
    410     function test_orderby() {
     410    public function test_orderby() {
    411411        // 'rand' is a valid value.
    412412        $q = new WP_Query( array( 'orderby' => 'rand' ) );
Note: See TracChangeset for help on using the changeset viewer.