Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined funcs, reference this scope directly instead. #2094

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/_support/Provider/Controller_Test_Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ 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;
},
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.
Expand Down Expand Up @@ -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 ) ) {
Expand Down
Loading