public function testRemoveVersion() { $doc = $this->dm->find($this->type, '/functional/versionTestObj'); $this->dm->checkpoint($doc); $linearVersionHistory = $this->dm->getAllLinearVersions($doc); $lastVersion = end($linearVersionHistory); $lastVersionName = $lastVersion['name']; // Create a new version so that we are not trying to remove the last version $this->dm->checkpoint($doc); // Remove the version $version = $this->dm->findVersionByName($this->type, '/functional/versionTestObj', $lastVersionName); $removedVersionPath = $version->id; $this->dm->removeVersion($version); // Check it's not in the history anymore $this->assertFalse($this->dm->getPhpcrSession()->nodeExists(dirname($removedVersionPath))); return $lastVersionName; }