Make WordPress Core

Changeset 64848


Ignore:
Timestamp:
10/27/2026 08:22:41 PM (11 days ago)
Author:
lancewillett
Message:

Tests: Clean up post types in archive and admin screen tests.

Unregister the custom post types used by wp_get_archives() and admin screen tests during teardown.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14926

Props huzaifaalmesbah.
See #65893.

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

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/includesScreen.php

    r64441 r64848  
    158158        public function tear_down() {
    159159                unset( $GLOBALS['wp_taxonomies']['old-or-new'] );
     160                unregister_post_type( 'value-add' );
     161                unregister_post_type( 'edit-some-thing' );
     162                unregister_post_type( 'comments' );
     163                unregister_post_type( 'tags' );
     164                unregister_post_type( 'type_shows_in_rest' );
     165
    160166                parent::tear_down();
    161167        }
  • trunk/tests/phpunit/tests/functions/wpGetArchives.php

    r63347 r64848  
    1616                $this->month_url = get_month_link( gmdate( 'Y' ), gmdate( 'm' ) );
    1717                $this->year_url  = get_year_link( gmdate( 'Y' ) );
     18        }
     19
     20        public function tear_down() {
     21                unregister_post_type( 'taco' );
     22
     23                parent::tear_down();
    1824        }
    1925
Note: See TracChangeset for help on using the changeset viewer.