From cb700c8b53cef78022bf6b5bd86c06dceda3239e Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Thu, 20 Jun 2024 22:38:09 +0300 Subject: [PATCH] Fix possible leaking tests --- tests/wpunit/AssetsTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/wpunit/AssetsTest.php b/tests/wpunit/AssetsTest.php index a1b8e73..ae6c686 100644 --- a/tests/wpunit/AssetsTest.php +++ b/tests/wpunit/AssetsTest.php @@ -32,6 +32,9 @@ public function tearDown() { */ public function unset_uopz_redefines() { if ( function_exists( 'uopz_redefine' ) ) { + // Restore in reverse order. + self::$uopz_redefines = array_reverse( self::$uopz_redefines ); + foreach ( self::$uopz_redefines as $restore_callback ) { $restore_callback(); }