From 7652a58ffc5fca2b055cda20f6aab279848ca20f Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 22 May 2024 07:14:53 +0200 Subject: [PATCH] Simply pass null --- tests/ComposerJsonTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/ComposerJsonTest.php b/tests/ComposerJsonTest.php index 93b29a95..82ef7d46 100644 --- a/tests/ComposerJsonTest.php +++ b/tests/ComposerJsonTest.php @@ -31,8 +31,7 @@ public function set_up() { $class_wp_cli_capture_exit = new \ReflectionProperty( 'WP_CLI', 'capture_exit' ); $class_wp_cli_capture_exit->setAccessible( true ); - $class_wp_cli = new \ReflectionClass( 'WP_CLI' ); - $class_wp_cli->setStaticPropertyValue( 'capture_exit', true ); + $class_wp_cli_capture_exit->setValue( null, true ); $this->temp_dir = Utils\get_temp_dir() . uniqid( 'wp-cli-test-package-composer-json-', true ) . '/'; mkdir( $this->temp_dir ); @@ -45,8 +44,7 @@ public function tear_down() { // Restore exit exception. $class_wp_cli_capture_exit = new \ReflectionProperty( 'WP_CLI', 'capture_exit' ); $class_wp_cli_capture_exit->setAccessible( true ); - $class_wp_cli = new \ReflectionClass( 'WP_CLI' ); - $class_wp_cli->setStaticPropertyValue( 'capture_exit', $this->prev_capture_exit ); + $class_wp_cli_capture_exit->setValue( null, $this->prev_capture_exit ); rmdir( $this->temp_dir );