diff --git a/eZ/Publish/Core/Persistence/Legacy/Tests/Content/MapperTest.php b/eZ/Publish/Core/Persistence/Legacy/Tests/Content/MapperTest.php index d3cf7d52a5..c19247656a 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Tests/Content/MapperTest.php +++ b/eZ/Publish/Core/Persistence/Legacy/Tests/Content/MapperTest.php @@ -6,6 +6,9 @@ */ namespace eZ\Publish\Core\Persistence\Legacy\Tests\Content; +use eZ\Publish\Core\Persistence\Legacy\Content\Gateway; +use eZ\Publish\Core\Persistence\Legacy\Content\StorageRegistry; +use Ibexa\Core\Persistence\Legacy\Content\Mapper\ResolveVirtualFieldSubscriber; use function count; use eZ\Publish\API\Repository\Values\Content\Relation as RelationValue; use eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter; @@ -227,7 +230,7 @@ public function testExtractContentFromRowsWithNewFieldDefinitions(): void 'ezdatetime', 'ezkeyword', 'eznumber', - ], count($rowsFixture)); + ], count($rowsFixture) - 1); $mapper = new Mapper( $reg, @@ -242,6 +245,7 @@ public function testExtractContentFromRowsWithNewFieldDefinitions(): void 'type' => 'eznumber', 'languageCode' => 'eng-US', 'value' => new FieldValue(), + 'versionNo' => 2, ]); $this->assertEquals( @@ -682,6 +686,10 @@ protected function getValueConverterRegistryMock() $this->valueConverterRegistryMock = $this->getMockBuilder(Registry::class) ->setMethods([]) ->getMock(); + + $this->valueConverterRegistryMock + ->method('getConverter') + ->willReturn($this->createMock(Converter::class)); } return $this->valueConverterRegistryMock; @@ -707,7 +715,16 @@ protected function getRelationCreateStructFixture() protected function getEventDispatcher(): EventDispatcherInterface { - return new EventDispatcher(); + $eventDispatcher = new EventDispatcher(); + $eventDispatcher->addSubscriber( + new ResolveVirtualFieldSubscriber( + $this->getValueConverterRegistryMock(), + new StorageRegistry([]), + $this->createMock(Gateway::class) + ) + ); + + return $eventDispatcher; } /**