-
Notifications
You must be signed in to change notification settings - Fork 7
Added recursive restore to allow also versions of children #108
Conversation
c385e37
to
37d84a2
Compare
37d84a2
to
267c328
Compare
267c328
to
4d0779c
Compare
4d0779c
to
ed6bacb
Compare
); | ||
} | ||
|
||
// remove child-nodes which does not exists in frozen-node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which do not exist in frozen node
@@ -343,6 +345,7 @@ public function testRestoreLocalizedProperties() | |||
$property3 = $this->prophesize(PropertyInterface::class); | |||
$property3->getName()->willReturn('jcr:uuid'); | |||
$node->getProperties()->willReturn([$property1->reveal(), $property2->reveal(), $property3->reveal()]); | |||
$node->getNodes()->willReturn([]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add also a test where the node has children, which should not be copied (as it is the case with the pages).
@danrot fixed |
$versionHistory->getVersion('1.0')->willReturn($version->reveal()); | ||
$version->getFrozenNode()->willReturn($frozenNode->reveal()); | ||
|
||
$this->versionSubscriber->restoreProperties($event->reveal()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's not a single assertion in this test, so we cannot be sure that the child node has not been touched...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not explicit but we could. every not mocked method call would let this test fail - but i will add some assertions.
765b41c
to
0b55bf6
Compare
$versionHistory->getVersion('1.0')->willReturn($version->reveal()); | ||
$version->getFrozenNode()->willReturn($frozenNode->reveal()); | ||
|
||
// the child-node should not be touched |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danrot i have added assertions
This PR extends the
VersionSubscriber
to allow also restore children.Requires jackalope/jackalope ^1.2.8