public function testRemoveVersion()
 {
     $doc = $this->dm->find($this->typeVersion, '/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->typeVersion, '/functional/versionTestObj', $lastVersionName);
     $removedVersionPath = $version->id;
     $this->dm->removeVersion($version);
     // Check it's not in the history anymore
     $this->assertFalse($this->dm->getPhpcrSession()->nodeExists(PathHelper::getParentPath($removedVersionPath)));
     return $lastVersionName;
 }