self::
assertSame(['foo' => 'default', 'bar' => 'default'
],
$metadata->
getNormalizationContextForGroups([]));
self::
assertSame(['foo' => 'overridden', 'bar' => 'default'
],
$metadata->
getNormalizationContextForGroups(['a'
]));
self::
assertSame(['foo' => 'overridden', 'bar' => 'default'
],
$metadata->
getNormalizationContextForGroups(['b'
]));
self::
assertSame(['foo' => 'default', 'bar' => 'overridden'
],
$metadata->
getNormalizationContextForGroups(['c'
]));
self::
assertSame(['foo' => 'overridden', 'bar' => 'overridden'
],
$metadata->
getNormalizationContextForGroups(['b', 'c'
]));
$metadata->
setDenormalizationContextForGroups(['foo' => 'default', 'bar' => 'default'
],
[]);
$metadata->
setDenormalizationContextForGroups(['foo' => 'overridden'
],
['a', 'b'
]);
$metadata->
setDenormalizationContextForGroups(['bar' => 'overridden'
],
['c'
]);
self::
assertSame(['foo' => 'default', 'bar' => 'default'
],
$metadata->
getDenormalizationContextForGroups([]));
self::
assertSame(['foo' => 'overridden', 'bar' => 'default'
],
$metadata->
getDenormalizationContextForGroups(['a'
]));
self::
assertSame(['foo' => 'overridden', 'bar' => 'default'
],
$metadata->
getDenormalizationContextForGroups(['b'
]));
self::
assertSame(['foo' => 'default', 'bar' => 'overridden'
],
$metadata->
getDenormalizationContextForGroups(['c'
]));
self::
assertSame(['foo' => 'overridden', 'bar' => 'overridden'
],
$metadata->
getDenormalizationContextForGroups(['b', 'c'
]));
} public function testMerge() { $serializedPath =
new PropertyPath('[a4][a5]'
);
$attributeMetadata1 =
new AttributeMetadata('a1'
);
$attributeMetadata1->
addGroup('a'
);