Make WordPress Core

Changeset 54710 for trunk


Ignore:
Timestamp:
10/28/2022 02:08:20 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Move the tests for WP class methods to the wp directory.

This aims to bring some consistency to the location of the tests for this class.

Includes adding the missing @covers tags.

Follow-up to [36177], [51622], [54250].

Props pbearne, SergeyBiryukov.
See #56793, #56782.

Location:
trunk/tests/phpunit/tests/wp
Files:
2 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/wp/addQueryVar.php

    r54642 r54710  
    33/**
    44 * @group wp
     5 *
     6 * @covers WP::add_query_var
    57 */
    6 class Tests_WP extends WP_UnitTestCase {
     8class Tests_WP_AddQueryVar extends WP_UnitTestCase {
     9
    710        /**
    811         * @var WP
     
    2629                $this->assertContains( 'test2', $this->wp->public_query_vars );
    2730        }
    28 
    29         public function test_remove_query_var() {
    30                 $public_qv_count = count( $this->wp->public_query_vars );
    31 
    32                 $this->wp->add_query_var( 'test' );
    33                 $this->assertContains( 'test', $this->wp->public_query_vars );
    34                 $this->wp->remove_query_var( 'test' );
    35 
    36                 $this->assertCount( $public_qv_count, $this->wp->public_query_vars );
    37         }
    3831}
  • trunk/tests/phpunit/tests/wp/parseRequest.php

    r52815 r54710  
    33/**
    44 * @group wp
     5 *
    56 * @covers WP::parse_request
    67 */
    78class Tests_WP_ParseRequest extends WP_UnitTestCase {
     9
    810        /**
    911         * @var WP
  • trunk/tests/phpunit/tests/wp/removeQueryVar.php

    r54642 r54710  
    33/**
    44 * @group wp
     5 *
     6 * @covers WP::remove_query_var
    57 */
    6 class Tests_WP extends WP_UnitTestCase {
     8class Tests_WP_RemoveQueryVar extends WP_UnitTestCase {
     9
    710        /**
    811         * @var WP
     
    1316                parent::set_up();
    1417                $this->wp = new WP();
    15         }
    16 
    17         public function test_add_query_var() {
    18                 $public_qv_count = count( $this->wp->public_query_vars );
    19 
    20                 $this->wp->add_query_var( 'test' );
    21                 $this->wp->add_query_var( 'test2' );
    22                 $this->wp->add_query_var( 'test' );
    23 
    24                 $this->assertCount( $public_qv_count + 2, $this->wp->public_query_vars );
    25                 $this->assertContains( 'test', $this->wp->public_query_vars );
    26                 $this->assertContains( 'test2', $this->wp->public_query_vars );
    2718        }
    2819
  • trunk/tests/phpunit/tests/wp/sendHeaders.php

    r54636 r54710  
    33/**
    44 * @group wp
     5 *
    56 * @covers WP::send_headers
    67 */
Note: See TracChangeset for help on using the changeset viewer.