diff --git a/tests/_support/Provider/Controller_Test_Case.php b/tests/_support/Provider/Controller_Test_Case.php index ce82b95aed..cfdaf2aab0 100644 --- a/tests/_support/Provider/Controller_Test_Case.php +++ b/tests/_support/Provider/Controller_Test_Case.php @@ -99,7 +99,7 @@ protected function setUpTestCase() { $test_services = clone $original_services; // From now on calls to the Service Locator (the `tribe` function) will be redirected to a test Service Locator. - set_fn_return( + $this->set_fn_return( 'tribe', static function ( $key = null ) use ( $test_services ) { return $key ? $test_services->get( $key ) : $test_services; @@ -107,7 +107,7 @@ static function ( $key = null ) use ( $test_services ) { true ); // Redirect calls to init the container too. - set_fn_return( Container::class, 'init', $test_services ); + $this->set_fn_return( Container::class, 'init', $test_services ); $this->test_services = $test_services; // We should now be working with the test Service Locator. @@ -357,7 +357,7 @@ protected function unregister_all_controller_instances( Controller $original_con // Here we use the controller to let use know what filters it would hook to by // intercepting the `add_filter` function. $hooked = []; - set_fn_return( + $this->set_fn_return( 'add_filter', function ( $tag, $function_to_add, $priority = 10 ) use ( &$hooked ) { if ( ! ( is_array( $function_to_add ) && $function_to_add[0] instanceof Controller ) ) {