Make WordPress Core


Ignore:
Timestamp:
05/20/2015 07:02:42 PM (9 years ago)
Author:
johnbillion
Message:

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

Fixes #32404

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/option/multisite.php

    r31623 r32518  
    101101
    102102    function test_with_another_site() {
    103         global $current_site, $base;
    104 
    105         $title = 'Fooblog';
    106         $domain = 'blogoptiontest';
    107 
    108         if ( is_subdomain_install() ) {
    109             $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
    110             $path = $base;
    111         } else {
    112             $newdomain = $current_site->domain;
    113             $path = $base . $domain . '/';
    114         }
    115 
    116         $email = 'foo@foo.foo';
    117         $password = wp_generate_password( 12, false );
    118         $user_id = wpmu_create_user( $domain, $password, $email );
     103        $user_id = $this->factory->user->create();
    119104        $this->assertInternalType( 'integer', $user_id );
    120105
    121         $blog_id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' => 1 ), $current_site->id );
     106        $blog_id = $this->factory->blog->create( array(
     107            'user_id' => $user_id,
     108            'meta'    => array(
     109                'public' => 1,
     110            ),
     111        ) );
    122112        $this->assertInternalType( 'integer', $blog_id );
    123113
Note: See TracChangeset for help on using the changeset viewer.