$metadata->
setNormalizationContextForGroups(['foo' => 'default', 'bar' => 'default'
],
[]);
$metadata->
setNormalizationContextForGroups(['foo' => 'overridden'
],
['a', 'b'
]);
$metadata->
setNormalizationContextForGroups(['bar' => 'overridden'
],
['c'
]);
self::
assertSame([ '*' =>
['foo' => 'default', 'bar' => 'default'
],
'a' =>
['foo' => 'overridden'
],
'b' =>
['foo' => 'overridden'
],
'c' =>
['bar' => 'overridden'
],
],
$metadata->
getNormalizationContexts());
$metadata->
setDenormalizationContextForGroups(['foo' => 'default', 'bar' => 'default'
],
[]);
$metadata->
setDenormalizationContextForGroups(['foo' => 'overridden'
],
['a', 'b'
]);
$metadata->
setDenormalizationContextForGroups(['bar' => 'overridden'
],
['c'
]);
self::
assertSame([ '*' =>
['foo' => 'default', 'bar' => 'default'
],
'a' =>
['foo' => 'overridden'
],
'b' =>
['foo' => 'overridden'
],
'c' =>
['bar' => 'overridden'
],
],
$metadata->
getDenormalizationContexts());
}