mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@54710 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2,8 +2,11 @@
|
||||
|
||||
/**
|
||||
* @group wp
|
||||
*
|
||||
* @covers WP::add_query_var
|
||||
*/
|
||||
class Tests_WP extends WP_UnitTestCase {
|
||||
class Tests_WP_AddQueryVar extends WP_UnitTestCase {
|
||||
|
||||
/**
|
||||
* @var WP
|
||||
*/
|
||||
@@ -25,14 +28,4 @@ class Tests_WP extends WP_UnitTestCase {
|
||||
$this->assertContains( 'test', $this->wp->public_query_vars );
|
||||
$this->assertContains( 'test2', $this->wp->public_query_vars );
|
||||
}
|
||||
|
||||
public function test_remove_query_var() {
|
||||
$public_qv_count = count( $this->wp->public_query_vars );
|
||||
|
||||
$this->wp->add_query_var( 'test' );
|
||||
$this->assertContains( 'test', $this->wp->public_query_vars );
|
||||
$this->wp->remove_query_var( 'test' );
|
||||
|
||||
$this->assertCount( $public_qv_count, $this->wp->public_query_vars );
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
/**
|
||||
* @group wp
|
||||
*
|
||||
* @covers WP::parse_request
|
||||
*/
|
||||
class Tests_WP_ParseRequest extends WP_UnitTestCase {
|
||||
|
||||
/**
|
||||
* @var WP
|
||||
*/
|
||||
|
||||
29
tests/phpunit/tests/wp/removeQueryVar.php
Normal file
29
tests/phpunit/tests/wp/removeQueryVar.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @group wp
|
||||
*
|
||||
* @covers WP::remove_query_var
|
||||
*/
|
||||
class Tests_WP_RemoveQueryVar extends WP_UnitTestCase {
|
||||
|
||||
/**
|
||||
* @var WP
|
||||
*/
|
||||
protected $wp;
|
||||
|
||||
public function set_up() {
|
||||
parent::set_up();
|
||||
$this->wp = new WP();
|
||||
}
|
||||
|
||||
public function test_remove_query_var() {
|
||||
$public_qv_count = count( $this->wp->public_query_vars );
|
||||
|
||||
$this->wp->add_query_var( 'test' );
|
||||
$this->assertContains( 'test', $this->wp->public_query_vars );
|
||||
$this->wp->remove_query_var( 'test' );
|
||||
|
||||
$this->assertCount( $public_qv_count, $this->wp->public_query_vars );
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
/**
|
||||
* @group wp
|
||||
*
|
||||
* @covers WP::send_headers
|
||||
*/
|
||||
class Tests_WP_SendHeaders extends WP_UnitTestCase {
|
||||
|
||||
Reference in New Issue
Block a user