Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Added recursive restore to allow also versions of children #108

Merged
merged 2 commits into from
Apr 19, 2017

Conversation

wachterjohannes
Copy link
Member

@wachterjohannes wachterjohannes commented Mar 22, 2017

This PR extends the VersionSubscriber to allow also restore children.

Requires jackalope/jackalope ^1.2.8

@wachterjohannes wachterjohannes force-pushed the feature/child-versions branch 4 times, most recently from c385e37 to 37d84a2 Compare March 23, 2017 10:26
@wachterjohannes wachterjohannes force-pushed the feature/child-versions branch from 37d84a2 to 267c328 Compare April 18, 2017 06:32
@wachterjohannes wachterjohannes force-pushed the feature/child-versions branch from 267c328 to 4d0779c Compare April 18, 2017 07:08
@wachterjohannes wachterjohannes changed the base branch from master to develop April 18, 2017 07:08
@wachterjohannes wachterjohannes force-pushed the feature/child-versions branch from 4d0779c to ed6bacb Compare April 18, 2017 07:09
@wachterjohannes wachterjohannes requested a review from danrot April 18, 2017 07:09
);
}

// remove child-nodes which does not exists in frozen-node
Copy link
Contributor

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([]);
Copy link
Contributor

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).

@wachterjohannes
Copy link
Member Author

@danrot fixed

$versionHistory->getVersion('1.0')->willReturn($version->reveal());
$version->getFrozenNode()->willReturn($frozenNode->reveal());

$this->versionSubscriber->restoreProperties($event->reveal());
Copy link
Contributor

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...

Copy link
Member Author

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.

@wachterjohannes wachterjohannes force-pushed the feature/child-versions branch from 765b41c to 0b55bf6 Compare April 19, 2017 10:25
$versionHistory->getVersion('1.0')->willReturn($version->reveal());
$version->getFrozenNode()->willReturn($frozenNode->reveal());

// the child-node should not be touched
Copy link
Member Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants