Skip to content

Commit d05c9ce

Browse files
committed
Tests: Reset changeset revisions support between Customizer tests.
Two tests in `Tests_WP_Customize_Manager` add `revisions` support to the `customize_changeset` post type but never remove it, and post type supports are not reset between tests. Any changeset published in a later test therefore has revisions enabled, so `_wp_customize_publish_changeset()` does not trash it. This breaks assertions that expect a published changeset to be trashed, as happens when the tests run in a different order or are inherited by a subclass. The support is now removed in `tear_down()`. Follow-up to r38810, r47633. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@64116 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 069b360 commit d05c9ce

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎tests/phpunit/tests/customize/manager.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ public function tear_down() {
8888
unset( $GLOBALS['wp_customize'] );
8989
$_REQUEST = array();
9090
$GLOBALS['_wp_theme_features'] = self::$theme_features;
91+
92+
// Undo enabling revisions for changesets, since post type supports are not reset between tests.
93+
remove_post_type_support( 'customize_changeset', 'revisions' );
94+
9195
parent::tear_down();
9296
}
9397

0 commit comments

Comments
 (0)