6
6
*/
7
7
namespace eZ \Publish \Core \Persistence \Legacy \Tests \Content ;
8
8
9
+ use eZ \Publish \Core \Persistence \Legacy \Content \Gateway ;
10
+ use eZ \Publish \Core \Persistence \Legacy \Content \StorageRegistry ;
11
+ use Ibexa \Core \Persistence \Legacy \Content \Mapper \ResolveVirtualFieldSubscriber ;
9
12
use function count ;
10
13
use eZ \Publish \API \Repository \Values \Content \Relation as RelationValue ;
11
14
use eZ \Publish \Core \Persistence \Legacy \Content \FieldValue \Converter ;
@@ -227,7 +230,7 @@ public function testExtractContentFromRowsWithNewFieldDefinitions(): void
227
230
'ezdatetime ' ,
228
231
'ezkeyword ' ,
229
232
'eznumber ' ,
230
- ], count ($ rowsFixture ));
233
+ ], count ($ rowsFixture ) - 1 );
231
234
232
235
$ mapper = new Mapper (
233
236
$ reg ,
@@ -242,6 +245,7 @@ public function testExtractContentFromRowsWithNewFieldDefinitions(): void
242
245
'type ' => 'eznumber ' ,
243
246
'languageCode ' => 'eng-US ' ,
244
247
'value ' => new FieldValue (),
248
+ 'versionNo ' => 2 ,
245
249
]);
246
250
247
251
$ this ->assertEquals (
@@ -682,6 +686,10 @@ protected function getValueConverterRegistryMock()
682
686
$ this ->valueConverterRegistryMock = $ this ->getMockBuilder (Registry::class)
683
687
->setMethods ([])
684
688
->getMock ();
689
+
690
+ $ this ->valueConverterRegistryMock
691
+ ->method ('getConverter ' )
692
+ ->willReturn ($ this ->createMock (Converter::class));
685
693
}
686
694
687
695
return $ this ->valueConverterRegistryMock ;
@@ -707,7 +715,16 @@ protected function getRelationCreateStructFixture()
707
715
708
716
protected function getEventDispatcher (): EventDispatcherInterface
709
717
{
710
- return new EventDispatcher ();
718
+ $ eventDispatcher = new EventDispatcher ();
719
+ $ eventDispatcher ->addSubscriber (
720
+ new ResolveVirtualFieldSubscriber (
721
+ $ this ->getValueConverterRegistryMock (),
722
+ new StorageRegistry ([]),
723
+ $ this ->createMock (Gateway::class)
724
+ )
725
+ );
726
+
727
+ return $ eventDispatcher ;
711
728
}
712
729
713
730
/**
0 commit comments