@@ -562,7 +562,7 @@ public function testChildContextKeepsOriginalContextCacheKey()
562
562
];
563
563
564
564
$ normalizer = new class () extends AbstractObjectNormalizerDummy {
565
- public ? string $ childContextCacheKey = null ;
565
+ public $ childContextCacheKey = null ;
566
566
567
567
protected function extractAttributes (object $ object , string $ format = null , array $ context = []): array
568
568
{
@@ -584,14 +584,17 @@ protected function createChildContext(array $parentContext, string $attribute, ?
584
584
};
585
585
586
586
$ serializer = new Serializer ([$ normalizer ]);
587
- $ serializer ->normalize ($ foobar , null , ['cache_key ' => 'hardcoded ' ]);
587
+ $ serializer ->normalize ($ foobar , null , ['cache_key ' => 'hardcoded ' , 'iri ' => '/dummy/1 ' ]);
588
+ $ firstCacheKey = $ normalizer ->childContextCacheKey ;
588
589
589
- $ this ->assertSame ('hardcoded-foo ' , $ normalizer ->childContextCacheKey );
590
+ $ serializer ->normalize ($ foobar , null , ['cache_key ' => 'hardcoded ' , 'iri ' => '/dummy/2 ' ]);
591
+ $ secondCacheKey = $ normalizer ->childContextCacheKey ;
592
+
593
+ $ this ->assertSame ($ firstCacheKey , $ secondCacheKey );
590
594
}
591
595
592
596
public function testChildContextCacheKeyStaysFalseWhenOriginalCacheKeyIsFalse ()
593
597
{
594
- xdebug_break ();
595
598
$ foobar = new Dummy ();
596
599
$ foobar ->foo = new EmptyDummy ();
597
600
$ foobar ->bar = 'bar ' ;
@@ -603,7 +606,7 @@ public function testChildContextCacheKeyStaysFalseWhenOriginalCacheKeyIsFalse()
603
606
];
604
607
605
608
$ normalizer = new class () extends AbstractObjectNormalizerDummy {
606
- public ? bool $ childContextCacheKey = null ;
609
+ public $ childContextCacheKey = null ;
607
610
608
611
protected function extractAttributes (object $ object , string $ format = null , array $ context = []): array
609
612
{
0 commit comments