Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
IgnoreDummy example
yield
[
new
ObjectNormalizer
(
null,
$nameConverter
, null,
$extractor
)
]
;
}
public
function
testIgnore
(
)
{
$classMetadata
=
new
ClassMetadata
(
IgnoreDummy::
class
)
;
$attributeMetadata
=
new
AttributeMetadata
(
'ignored1'
)
;
$attributeMetadata
->
setIgnore
(
true
)
;
$classMetadata
->
addAttributeMetadata
(
$attributeMetadata
)
;
$this
->classMetadata->
method
(
'getMetadataFor'
)
->
willReturn
(
$classMetadata
)
;
$dummy
=
new
IgnoreDummy
(
)
;
$dummy
->ignored1 = 'hello';
$normalizer
=
new
PropertyNormalizer
(
$this
->classMetadata
)
;
$this
->
assertSame
(
[
]
,
$normalizer
->
normalize
(
$dummy
)
)
;
}
}