Test looping over metadata

This commit is contained in:
brabli
2025-12-12 12:12:13 +00:00
parent fe133f1114
commit b889fb16ba

View File

@@ -60,5 +60,18 @@ final class MetadataTest extends TestCase
$result = $this->metadata->isSet('missing'); $result = $this->metadata->isSet('missing');
$this->assertFalse($result); $this->assertFalse($result);
} }
public function testLoopOverMetadata(): void
{
$this->metadata->set("a", "A")->set("b", "B")->set("c", "C");
$result = [];
foreach ($this->metadata as $key => $value) {
$result[$key] = $value;
}
$this->assertSame(["a" => "A", "b" => "B", "c" => "C"], $result);
}
} }