Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / serializer / Tests / Mapping / AttributeMetadataTest.php
index f08062369c70441f10ff3181fb2c73fdde17596e..16ebcb1aac8dc02eef162d9bb74a2ae56c7ccd41 100644 (file)
@@ -41,6 +41,14 @@ class AttributeMetadataTest extends TestCase
         $this->assertEquals(array('a', 'b'), $attributeMetadata->getGroups());
     }
 
+    public function testMaxDepth()
+    {
+        $attributeMetadata = new AttributeMetadata('name');
+        $attributeMetadata->setMaxDepth(69);
+
+        $this->assertEquals(69, $attributeMetadata->getMaxDepth());
+    }
+
     public function testMerge()
     {
         $attributeMetadata1 = new AttributeMetadata('a1');
@@ -50,10 +58,12 @@ class AttributeMetadataTest extends TestCase
         $attributeMetadata2 = new AttributeMetadata('a2');
         $attributeMetadata2->addGroup('a');
         $attributeMetadata2->addGroup('c');
+        $attributeMetadata2->setMaxDepth(2);
 
         $attributeMetadata1->merge($attributeMetadata2);
 
         $this->assertEquals(array('a', 'b', 'c'), $attributeMetadata1->getGroups());
+        $this->assertEquals(2, $attributeMetadata1->getMaxDepth());
     }
 
     public function testSerialize()
@@ -61,6 +71,7 @@ class AttributeMetadataTest extends TestCase
         $attributeMetadata = new AttributeMetadata('attribute');
         $attributeMetadata->addGroup('a');
         $attributeMetadata->addGroup('b');
+        $attributeMetadata->setMaxDepth(3);
 
         $serialized = serialize($attributeMetadata);
         $this->assertEquals($attributeMetadata, unserialize($serialized));