diff --git a/tests/ContainerTest.php b/tests/ContainerTest.php index b4e51ae..96809e6 100644 --- a/tests/ContainerTest.php +++ b/tests/ContainerTest.php @@ -312,8 +312,8 @@ public function __invoke(ServerRequestInterface $request): Response }; $container = new Container([ - \stdClass::class => function (Container $container) { - return (object)['container' => spl_object_hash($container)]; + \stdClass::class => function (Container $instance) use (&$container) { + return (object)['container' => $instance === $container]; } ]); @@ -323,7 +323,7 @@ public function __invoke(ServerRequestInterface $request): Response $response = $callable($request); $this->assertInstanceOf(ResponseInterface::class, $response); $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('{"container":"' . spl_object_hash($container) . '"}', (string) $response->getBody()); + $this->assertEquals('{"container":true}', (string) $response->getBody()); } public function testCallableTwiceReturnsCallableForClassNameViaAutowiringWithFactoryFunctionForDependencyWillCallFactoryOnlyOnce(): void