diff --git a/Neos.ContentRepository/Classes/Domain/Model/NodeData.php b/Neos.ContentRepository/Classes/Domain/Model/NodeData.php index b8ab6a31dd0..4bfff8a95e1 100644 --- a/Neos.ContentRepository/Classes/Domain/Model/NodeData.php +++ b/Neos.ContentRepository/Classes/Domain/Model/NodeData.php @@ -1,4 +1,5 @@ getContentObject(); diff --git a/Neos.ContentRepository/Tests/Unit/Domain/Model/NodeDataTest.php b/Neos.ContentRepository/Tests/Unit/Domain/Model/NodeDataTest.php index ae5851f639f..2c4599e70e8 100644 --- a/Neos.ContentRepository/Tests/Unit/Domain/Model/NodeDataTest.php +++ b/Neos.ContentRepository/Tests/Unit/Domain/Model/NodeDataTest.php @@ -667,6 +667,24 @@ public function similarizeClearsPropertiesBeforeAddingNewOnes() self::assertEquals($expectedProperties, $this->nodeData->getProperties()); } + /** + * @test + */ + public function similarizeCopiesCreationAndLastModificationDateTimes() + { + $creationDateTime = \DateTime::createFromFormat('Y-m-d', '2000-01-01 12:00:00'); + + /** @var $sourceNode NodeData */ + $sourceNode = $this->getAccessibleMock(NodeData::class, ['addOrUpdate'], ['/foo/bar', $this->mockWorkspace]); + $this->inject($sourceNode, 'nodeTypeManager', $this->mockNodeTypeManager); + $sourceNode->_set('nodeDataRepository', $this->createMock(RepositoryInterface::class)); + $sourceNode->_set('creationDateTime', $creationDateTime); + + $this->nodeData->similarize($sourceNode); + + self::assertSame($creationDateTime, $this->nodeData->getCreationDateTime()); + } + /** * @test */