diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php index 4168809baf..c396991a43 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php @@ -139,7 +139,8 @@ protected function setUp() { ->register('http_client_factory', 'Drupal\Core\Http\ClientFactory') ->setArguments([new Reference('http_handler_stack')]); $handler_stack = HandlerStack::create(); - $handler_stack->push((new TestHttpClientMiddleware())(), 'test.http_client.middleware'); + $middleware = new TestHttpClientMiddleware(); + $handler_stack->push($middleware(), 'test.http_client.middleware'); $this->container ->set('http_handler_stack', $handler_stack);