[], 'bar' => [], ]); $visited = [...(new NodeTraverser( fn (Node $node) => $node ))->traverse($node)]; self::assertContains($node, $visited); self::assertContains($node->children()['foo'], $visited); self::assertContains($node->children()['bar'], $visited); } }