99use PhpList \Core \Domain \Subscription \Model \Subscriber ;
1010use PhpList \Core \Domain \Subscription \Model \SubscriberList ;
1111use PhpList \Core \Domain \Subscription \Model \Subscription ;
12+ use PhpList \RestBundle \Subscription \Serializer \SubscriberHistoryNormalizer ;
1213use PhpList \RestBundle \Subscription \Serializer \SubscriberListNormalizer ;
1314use PhpList \RestBundle \Subscription \Serializer \SubscriberNormalizer ;
1415use PHPUnit \Framework \TestCase ;
@@ -18,7 +19,7 @@ class SubscriberNormalizerTest extends TestCase
1819{
1920 public function testSupportsNormalization (): void
2021 {
21- $ normalizer = new SubscriberNormalizer (new SubscriberListNormalizer ());
22+ $ normalizer = new SubscriberNormalizer (new SubscriberListNormalizer (), new SubscriberHistoryNormalizer () );
2223 $ subscriber = $ this ->createMock (Subscriber::class);
2324
2425 $ this ->assertTrue ($ normalizer ->supportsNormalization ($ subscriber ));
@@ -50,7 +51,7 @@ public function testNormalize(): void
5051 $ subscriber ->method ('isDisabled ' )->willReturn (false );
5152 $ subscriber ->method ('getSubscriptions ' )->willReturn (new ArrayCollection ([$ subscription ]));
5253
53- $ normalizer = new SubscriberNormalizer (new SubscriberListNormalizer ());
54+ $ normalizer = new SubscriberNormalizer (new SubscriberListNormalizer (), new SubscriberHistoryNormalizer () );
5455
5556 $ expected = [
5657 'id ' => 101 ,
@@ -73,15 +74,16 @@ public function testNormalize(): void
7374 'public ' => true ,
7475 'category ' => '' ,
7576 ]
76- ]
77+ ],
78+ 'history ' => [],
7779 ];
7880
7981 $ this ->assertSame ($ expected , $ normalizer ->normalize ($ subscriber ));
8082 }
8183
8284 public function testNormalizeWithInvalidObject (): void
8385 {
84- $ normalizer = new SubscriberNormalizer (new SubscriberListNormalizer ());
86+ $ normalizer = new SubscriberNormalizer (new SubscriberListNormalizer (), new SubscriberHistoryNormalizer () );
8587 $ this ->assertSame ([], $ normalizer ->normalize (new stdClass ()));
8688 }
8789}
0 commit comments