public function testIgnore() { $attributeMetadata =
new AttributeMetadata('ignored'
);
$this->
assertFalse($attributeMetadata->
isIgnored());
$attributeMetadata->
setIgnore(true
);
$this->
assertTrue($attributeMetadata->
isIgnored());
} public function testSetContexts() { $metadata =
new AttributeMetadata('a1'
);
$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'
],
[]);