public function testRestoreBaseProperties() { // TODO also check for primary node type once it can be changed $nodePath = '/tests_version_base/versioned'; $version = $this->vm->checkpoint($nodePath); $this->vm->checkout($nodePath); $node = $this->session->getNode($nodePath); $node->addMixin('mix:created'); $this->session->save(); $node = $this->session->getNode($nodePath); $this->assertContains('mix:created', $node->getPropertyValue('jcr:mixinTypes')); $this->assertTrue($node->hasProperty('jcr:created')); $this->vm->restore(true, $version); $node = $this->session->getNode($nodePath); $this->assertEquals(array('mix:versionable'), $node->getPropertyValue('jcr:mixinTypes')); $this->assertFalse($node->hasProperty('jcr:created')); }
/** * Check $version->remove() is not possible. This must go through VersionHistory::remove. * * @expectedException \PHPCR\RepositoryException */ public function testNodeRemoveOnVersion() { $version = $this->vm->checkpoint('/tests_version_base/simpleVersioned'); $version->remove(); }
/** * Try removing an unexisting version. * * @expectedException \PHPCR\Version\VersionException */ public function testDeleteUnexistingVersion() { $this->vm->checkpoint('/tests_version_base/versioned'); $history = $this->vm->getVersionHistory('/tests_version_base/versioned'); $history->removeVersion('unexisting'); }