diff options
Diffstat (limited to 'tests/mock/container_builder.php')
-rw-r--r-- | tests/mock/container_builder.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/mock/container_builder.php b/tests/mock/container_builder.php index 297e3a65e6..e04a83804d 100644 --- a/tests/mock/container_builder.php +++ b/tests/mock/container_builder.php @@ -52,7 +52,15 @@ class phpbb_mock_container_builder implements ContainerInterface { if ($this->has($id)) { - return $this->services[$id]; + $service = $this->services[$id]; + if (is_array($service) && is_callable($service[0])) + { + return call_user_func_array($service[0], $service[1]); + } + else + { + return $service; + } } throw new Exception('Could not find service: ' . $id); |