Make WordPress Core

Changeset 65727


Ignore:
Timestamp:
11/20/2026 04:44:52 PM (6 days ago)
Author:
lancewillett
Message:

Tests: Isolate rewrite state in term link and redirect tests.

Skip the rewrite flushes in the term link tests and unregister the random post type before teardown replaces the request.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/16111, ​https://github.com/WordPress/wordpress-develop/pull/16112

Props faisalahammad.
See #66755.

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

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query/randomContentRedirect.php

    r65542 r65727  
    254254                unregister_post_type( 'wptests_unsearchable' );
    255255                unregister_taxonomy( 'wptests_genre' );
     256
     257                /*
     258                 * The `random` post type shares the `random` query variable with core. Unregister it
     259                 * before the request is reset, as the reset at the start of the next test would remove
     260                 * the query variable from that test's request.
     261                 */
     262                unregister_post_type( 'random' );
    256263
    257264                parent::tear_down();
  • trunk/tests/phpunit/tests/term/getTermLink.php

    r65285 r65727  
    195195                );
    196196
    197                 flush_rewrite_rules();
    198 
    199197                $t1 = self::factory()->term->create(
    200198                        array(
    … …  
    229227                        )
    230228                );
    231 
    232                 flush_rewrite_rules();
    233229
    234230                $t1 = self::factory()->term->create(
Note: See TracChangeset for help on using the changeset viewer.