factory = new EmptyResponseImplicitOptionsMiddlewareFactory(); } #[Test] public function serviceIsCreated(): void { $instance = ($this->factory)(); self::assertInstanceOf(ImplicitOptionsMiddleware::class, $instance); } #[Test] public function responsePrototypeIsEmptyResponse(): void { $instance = ($this->factory)(); $ref = new ReflectionObject($instance); $prop = $ref->getProperty('responseFactory'); $prop->setAccessible(true); /** @var ResponseFactoryInterface $value */ $value = $prop->getValue($instance); self::assertInstanceOf(EmptyResponse::class, $value->createResponse()); } }