@@ -76,18 +76,22 @@ public function testNormalize()
76
76
77
77
$ dummy = new Dummy ();
78
78
$ dummy ->setName ('foo ' );
79
+ $ dummy ->setAlias ('ignored ' );
79
80
$ dummy ->setRelatedDummy ($ relatedDummy );
80
81
$ dummy ->relatedDummies ->add (new RelatedDummy ());
81
82
82
83
$ propertyNameCollectionFactoryProphecy = $ this ->prophesize (PropertyNameCollectionFactoryInterface::class);
83
84
$ propertyNameCollectionFactoryProphecy ->create (Dummy::class, [])->willReturn (
84
- new PropertyNameCollection (['name ' , 'relatedDummy ' , 'relatedDummies ' ])
85
+ new PropertyNameCollection (['name ' , 'alias ' , ' relatedDummy ' , 'relatedDummies ' ])
85
86
)->shouldBeCalled ();
86
87
87
88
$ propertyMetadataFactoryProphecy = $ this ->prophesize (PropertyMetadataFactoryInterface::class);
88
89
$ propertyMetadataFactoryProphecy ->create (Dummy::class, 'name ' , [])->willReturn (
89
90
new PropertyMetadata (new Type (Type::BUILTIN_TYPE_STRING ), '' , true )
90
91
)->shouldBeCalled ();
92
+ $ propertyMetadataFactoryProphecy ->create (Dummy::class, 'alias ' , [])->willReturn (
93
+ new PropertyMetadata (new Type (Type::BUILTIN_TYPE_STRING ), '' , true )
94
+ )->shouldBeCalled ();
91
95
$ propertyMetadataFactoryProphecy ->create (Dummy::class, 'relatedDummy ' , [])->willReturn (
92
96
new PropertyMetadata (new Type (Type::BUILTIN_TYPE_OBJECT , false , RelatedDummy::class), '' , true , false , false )
93
97
)->shouldBeCalled ();
@@ -134,6 +138,7 @@ public function testNormalize()
134
138
$ propertyAccesorProphecy ->reveal (),
135
139
]);
136
140
$ normalizer ->setSerializer ($ serializerProphecy ->reveal ());
141
+ $ normalizer ->setIgnoredAttributes (['alias ' ]);
137
142
138
143
$ this ->assertEquals ([
139
144
'name ' => 'foo ' ,
0 commit comments