Properly set $subdomain_error to false when applicable in ms_subdomain_constants(). This was previously untestable because it used static vars: use globals instead.

Adds unit test.
Fixes #28697.


git-svn-id: https://develop.svn.wordpress.org/trunk@29200 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-07-16 22:34:18 +00:00
parent 8a5d825fac
commit bda6f0cffe
2 changed files with 25 additions and 10 deletions

View File

@@ -25,6 +25,17 @@ class Tests_MS extends WP_UnitTestCase {
$wpdb->suppress_errors( $this->suppress );
}
/**
* @ticket 28697
*/
function test_ms_subdomain_constants() {
global $subdomain_error;
$this->assertFalse( $subdomain_error );
ms_subdomain_constants();
$this->assertFalse( $subdomain_error );
}
function test_remove_user_from_blog() {
$user1 = $this->factory->user->create_and_get();
$user2 = $this->factory->user->create_and_get();