wordpress-develop/tests/phpunit/tests/wp/removeQueryVar.php
Sergey Biryukov 66da481c14 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
2022-10-28 14:08:20 +00:00

30 lines
561 B
PHP

<?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 );
}
}