Make WordPress Core


Ignore:
Timestamp:
06/11/2022 03:34:35 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Re-initialize WP_Rewrite before running wp_list_authors() tests.

This ensures that the expected results use the default permalink structure, not affected by other tests.

Follow-up to [27550], [27684], [53487].

See #55652.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user/wpListAuthors.php

    r53487 r53488  
    2828     */
    2929    public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
     30        global $wp_rewrite;
     31
    3032        self::$user_ids[] = $factory->user->create(
    3133            array(
     
    6163            )
    6264        );
     65
     66        /*
     67         * Re-initialize WP_Rewrite, so that get_author_posts_url() uses
     68         * the default permalink structure, not affected by other tests.
     69         */
     70        $wp_rewrite->init();
    6371
    6472        $count = 0;
Note: See TracChangeset for help on using the changeset viewer.