fn () => 'foo', 'bar' => fn () => 'bar', ])); $functions = iterator_to_array($functions); self::assertArrayHasKey('foo', $functions); self::assertArrayHasKey('bar', $functions); } public function test_function_object_remains_the_same(): void { $functions = (new FunctionsContainer(new FakeFunctionDefinitionRepository(), [fn () => 'foo'])); $functionA = $functions->get(0); $functionB = $functions->get(0); self::assertSame($functionA, $functionB); } }