Make WordPress Core


Ignore:
Timestamp:
06/15/2020 12:29:13 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Networks and Sites: Don't unnecessarily switch to the current blog in get_blog_details().

Props arpitgshah, djennez, acsnaterse, joostdevalk, SergeyBiryukov.
Fixes #50391.

File:
1 edited

Legend:

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

    r47012 r48044  
    141141            $site = get_blog_details( array( 'path' => '/foo/' ) );
    142142            $this->assertFalse( $site );
     143        }
     144
     145        /**
     146         * @ticket 50391
     147         */
     148        public function test_get_blog_details_does_not_switch_to_current_blog() {
     149            $count = did_action( 'switch_blog' );
     150
     151            get_blog_details();
     152            $this->assertSame( $count, did_action( 'switch_blog' ) );
    143153        }
    144154
Note: See TracChangeset for help on using the changeset viewer.