deserializer = new ItemDeserializer(); $this->serializer = new ItemSerializer(); } public function testAllVanillaItemsSerializableAndDeserializable() : void{ foreach(VanillaItems::getAll() as $item){ if($item->isNull()){ continue; } $itemData = $this->serializer->serialize($item); $newItem = $this->deserializer->deserialize($itemData); self::assertTrue($item->equalsExact($newItem)); } } public function testAllVanillaBlocksSerializableAndDeserializable() : void{ foreach(VanillaBlocks::getAll() as $block){ $item = $block->asItem(); if($item->isNull()){ continue; } $itemData = $this->serializer->serialize($item); $newItem = $this->deserializer->deserialize($itemData); self::assertTrue($item->equalsExact($newItem)); } } }