Make WordPress Core

Ticket #32404: 32404.diff

File 32404.diff, 1.2 KB (added by johnbillion, 10 years ago)
  • tests/phpunit/tests/option/multisite.php

     
    100100        }
    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
    124114                $key = rand_str();