Use the available user and blog factories in the `Tests_Multisite_Option::test_with_another_site()` test.

Fixes #32404


git-svn-id: https://develop.svn.wordpress.org/trunk@32518 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2015-05-20 19:02:42 +00:00
parent e088947cea
commit 064bed9792
1 changed files with 7 additions and 17 deletions

View File

@ -100,25 +100,15 @@ class Tests_Multisite_Option extends WP_UnitTestCase {
}
function test_with_another_site() {
global $current_site, $base;
$title = 'Fooblog';
$domain = 'blogoptiontest';
if ( is_subdomain_install() ) {
$newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
$path = $base;
} else {
$newdomain = $current_site->domain;
$path = $base . $domain . '/';
}
$email = 'foo@foo.foo';
$password = wp_generate_password( 12, false );
$user_id = wpmu_create_user( $domain, $password, $email );
$user_id = $this->factory->user->create();
$this->assertInternalType( 'integer', $user_id );
$blog_id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' => 1 ), $current_site->id );
$blog_id = $this->factory->blog->create( array(
'user_id' => $user_id,
'meta' => array(
'public' => 1,
),
) );
$this->assertInternalType( 'integer', $blog_id );
$key = rand_str();