Make WordPress Core

Changeset 47012


Ignore:
Timestamp:
12/25/2019 06:15:13 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Replace most instances of wpmu_delete_blog() not specifically testing that function with wp_delete_site().

Follow-up to [47011].

See #47195.

Location:
trunk/tests/phpunit/tests
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/link/getDashboardUrl.php

    r46586 r47012  
    6969        add_user_to_blog( get_current_blog_id(), self::$user_id, 'administrator' );
    7070
    71         wpmu_delete_blog( $site_id, true );
     71        wp_delete_site( $site_id );
    7272
    7373        $this->assertEquals( $expected, $result );
  • trunk/tests/phpunit/tests/multisite/bootstrap.php

    r46586 r47012  
    104104
    105105            foreach ( self::$site_ids as $id ) {
    106                 wpmu_delete_blog( $id, true );
     106                wp_delete_site( $id );
    107107            }
    108108
  • trunk/tests/phpunit/tests/multisite/getBlogDetails.php

    r46586 r47012  
    3636        public static function wpTearDownAfterClass() {
    3737            foreach ( self::$site_ids as $id ) {
    38                 wpmu_delete_blog( $id, true );
     38                wp_delete_site( $id );
    3939            }
    4040
  • trunk/tests/phpunit/tests/multisite/getIdFromBlogname.php

    r46586 r47012  
    7373
    7474            foreach ( self::$site_ids as $id ) {
    75                 wpmu_delete_blog( $id, true );
     75                wp_delete_site( $id );
    7676            }
    7777
  • trunk/tests/phpunit/tests/multisite/getMainSiteId.php

    r46586 r47012  
    5555        public static function wpTearDownAfterClass() {
    5656            foreach ( self::$site_ids as $id ) {
    57                 wpmu_delete_blog( $id, true );
     57                wp_delete_site( $id );
    5858            }
    5959
  • trunk/tests/phpunit/tests/multisite/getSite.php

    r46586 r47012  
    3535        public static function wpTearDownAfterClass() {
    3636            foreach ( self::$site_ids as $id ) {
    37                 wpmu_delete_blog( $id, true );
     37                wp_delete_site( $id );
    3838            }
    3939
  • trunk/tests/phpunit/tests/multisite/network.php

    r46586 r47012  
    6464
    6565            foreach ( self::$different_site_ids as $id ) {
    66                 wpmu_delete_blog( $id, true );
     66                wp_delete_site( $id );
    6767            }
    6868
     
    156156
    157157            foreach ( $site_ids as $site_id ) {
    158                 wpmu_delete_blog( $site_id, true );
     158                wp_delete_site( $site_id );
    159159            }
    160160            wp_update_network_counts();
     
    176176
    177177            foreach ( $site_ids as $site_id ) {
    178                 wpmu_delete_blog( $site_id, true );
     178                wp_delete_site( $site_id );
    179179            }
    180180            wp_update_network_counts();
     
    196196
    197197            foreach ( $site_ids as $site_id ) {
    198                 wpmu_delete_blog( $site_id, true );
     198                wp_delete_site( $site_id );
    199199            }
    200200            wp_update_network_counts();
     
    591591            $original_count = get_blog_count( self::$different_network_id );
    592592
    593             $site_id = self::factory()->blog->create(
    594                 array(
    595                     'domain'  => 'example.org',
    596                     'path'    => '/',
    597                     'site_id' => self::$different_network_id,
    598                 )
    599             );
     593            $site_id = wpmu_create_blog( 'example.org', '/', '', 1, array(), self::$different_network_id );
    600594
    601595            $result = get_blog_count( self::$different_network_id );
  • trunk/tests/phpunit/tests/multisite/site.php

    r46991 r47012  
    8080
    8181            foreach ( self::$site_ids as $id ) {
    82                 wpmu_delete_blog( $id, true );
     82                wp_delete_site( $id );
    8383            }
    8484
  • trunk/tests/phpunit/tests/multisite/siteDetails.php

    r46586 r47012  
    140140            $cached_details = wp_cache_get( $site->id, 'site-details' );
    141141
    142             wpmu_delete_blog( $id, true );
     142            wp_delete_site( $id );
    143143            wp_update_network_site_counts();
    144144
  • trunk/tests/phpunit/tests/multisite/siteMeta.php

    r46586 r47012  
    4242            }
    4343
    44             wpmu_delete_blog( self::$site_id, true );
    45             wpmu_delete_blog( self::$site_id2, true );
     44            wp_delete_site( self::$site_id );
     45            wp_delete_site( self::$site_id2 );
    4646
    4747            wp_update_network_site_counts();
     
    214214            $this->assertSame( 'bar', get_site_meta( $site_id, 'foo1', true ) );
    215215
    216             wpmu_delete_blog( $site_id, true );
     216            wp_delete_site( $site_id );
    217217
    218218            $this->assertSame( '', get_site_meta( $site_id, 'foo', true ) );
  • trunk/tests/phpunit/tests/multisite/siteQuery.php

    r46586 r47012  
    106106
    107107            foreach ( self::$site_ids as $id ) {
    108                 wpmu_delete_blog( $id, true );
     108                wp_delete_site( $id );
    109109            }
    110110
  • trunk/tests/phpunit/tests/multisite/wpGetSites.php

    r46586 r47012  
    4444        public static function wpTearDownAfterClass() {
    4545            foreach ( self::$site_ids as $id ) {
    46                 wpmu_delete_blog( $id, true );
     46                wp_delete_site( $id );
    4747            }
    4848
  • trunk/tests/phpunit/tests/multisite/wpInstallDefaults.php

    r46586 r47012  
    2222
    2323            restore_current_blog();
    24             wpmu_delete_blog( $blog_id, true );
     24
     25            wp_delete_site( $blog_id );
    2526
    2627            $this->assertNotEmpty( $first_page->post_content );
     
    4748
    4849            restore_current_blog();
    49             wpmu_delete_blog( $blog_id, true );
     50
     51            wp_delete_site( $blog_id );
    5052
    5153            $this->assertNotEmpty( $first_page->post_content );
     
    7274
    7375            restore_current_blog();
    74             wpmu_delete_blog( $blog_id, true );
     76
     77            wp_delete_site( $blog_id );
    7578
    7679            $this->assertEquals( 'Some page content', $first_page->post_content );
  • trunk/tests/phpunit/tests/multisite/wpMSSitesListTable.php

    r46586 r47012  
    8484        public static function wpTearDownAfterClass() {
    8585            foreach ( self::$site_ids as $site_id ) {
    86                 wpmu_delete_blog( $site_id, true );
     86                wp_delete_site( $site_id );
    8787            }
    8888        }
  • trunk/tests/phpunit/tests/multisite/wpmuValidateBlogSignup.php

    r46586 r47012  
    4848            wpmu_delete_user( self::$existing_user_id );
    4949
    50             wpmu_delete_blog( self::$existing_blog_id, true );
     50            wp_delete_site( self::$existing_blog_id );
    5151        }
    5252
  • trunk/tests/phpunit/tests/rest-api/rest-users-controller.php

    r46657 r47012  
    137137
    138138        if ( is_multisite() ) {
    139             wpmu_delete_blog( self::$site, true );
     139            wp_delete_site( self::$site );
    140140        }
    141141
  • trunk/tests/phpunit/tests/user/getActiveBlogForUser.php

    r46586 r47012  
    5252            $result = get_active_blog_for_user( self::$user_id );
    5353
    54             wpmu_delete_blog( $site_id_one, true );
    55             wpmu_delete_blog( $site_id_two, true );
     54            wp_delete_site( $site_id_one );
     55            wp_delete_site( $site_id_two );
    5656
    5757            $this->assertEquals( $primary_site_id, $result->id );
     
    7070            $result = get_active_blog_for_user( self::$user_id );
    7171
    72             wpmu_delete_blog( $primary_site_id, true );
     72            wp_delete_site( $primary_site_id );
    7373
    7474            $this->assertEquals( $primary_site_id, $result->id );
     
    9393            $result = get_active_blog_for_user( self::$user_id );
    9494
    95             wpmu_delete_blog( $site_id, true );
     95            wp_delete_site( $site_id );
    9696
    9797            $this->assertEquals( $current_site_id, $result->id );
  • trunk/tests/phpunit/tests/user/multisite.php

    r46586 r47012  
    390390            restore_current_blog();
    391391
    392             wpmu_delete_blog( $site_id );
     392            wp_delete_site( $site_id );
    393393            wpmu_delete_user( $user_id );
    394394
     
    403403
    404404            $result = add_user_to_blog( 73622, $site_id, 'subscriber' );
    405             wpmu_delete_blog( $site_id );
     405
     406            wp_delete_site( $site_id );
    406407
    407408            $this->assertWPError( $result );
Note: See TracChangeset for help on using the changeset viewer.