Tests: Add a basic test for wp()
function.
Props pbearne, donmhico. Fixes #48844. git-svn-id: https://develop.svn.wordpress.org/trunk@47212 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
11eb80e59e
commit
2aecc8f3e6
@ -1270,6 +1270,7 @@ function wp_remote_fopen( $uri ) {
|
||||
*/
|
||||
function wp( $query_vars = '' ) {
|
||||
global $wp, $wp_query, $wp_the_query;
|
||||
|
||||
$wp->main( $query_vars );
|
||||
|
||||
if ( ! isset( $wp_the_query ) ) {
|
||||
|
19
tests/phpunit/tests/functions/wp.php
Normal file
19
tests/phpunit/tests/functions/wp.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @group functions.php
|
||||
* @group query
|
||||
*/
|
||||
class Tests_Functions_WP extends WP_UnitTestCase {
|
||||
|
||||
public function test_wp_sets_global_vars() {
|
||||
global $wp, $wp_query, $wp_the_query;
|
||||
|
||||
wp();
|
||||
|
||||
$this->assertInstanceOf( 'WP', $wp );
|
||||
$this->assertInstanceOf( 'WP_Query', $wp_query );
|
||||
$this->assertInstanceOf( 'WP_Query', $wp_the_query );
|
||||
}
|
||||
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @group functions.php
|
||||
*
|
||||
* Tests for the behavior of `wp_auth_check()`
|
||||
*
|
||||
* @group functions.php
|
||||
*/
|
||||
class Tests_Functions_WP_Auth_Check extends WP_UnitTestCase {
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @group external-http
|
||||
* @group functions.php
|
||||
*/
|
||||
class Tests_wp_remote_fopen extends WP_UnitTestCase {
|
||||
class Tests_Functions_wp_remote_fopen extends WP_UnitTestCase {
|
||||
|
||||
/**
|
||||
* @ticket 48845
|
||||
|
Loading…
Reference in New Issue
Block a user