Skip to content

Commit

Permalink
added a test adding a reference to a new node in a single transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 committed Oct 16, 2015
1 parent ac899c0 commit e24a969
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Writing/MixinReferenceableTest.php
Expand Up @@ -204,4 +204,17 @@ public function testSetUuidButNotReferenceableExisting()
{
$this->node->setProperty('jcr:uuid', 'dddd61c0-09ab-42a9-87c0-308ccc93aaaa');
}

public function testCreateReferenceInSingleTransaction()
{
$session = $this->renewSession();

$rootNode = $session->getNode('/');
$child1 = $rootNode->addNode('child1');
$child2 = $rootNode->addNode('child2');
$child2->addMixin('mix:referenceable');
$child1->setProperty('someref', $child2, PropertyType::REFERENCE);

$this->session->save();
}
}

0 comments on commit e24a969

Please sign in to comment.