public function testNoConflictIfClaimReleasedAfterDetect() { $this->detector->claim('A', 'package1'); $this->detector->claim('A', 'package2'); $this->assertCount(1, $this->detector->detectConflicts(array('A'))); $this->detector->release('A', 'package1'); $this->assertCount(0, $this->detector->detectConflicts(array('A'))); }
/** * {@inheritdoc} */ public function execute() { if (!$this->mapping->isLoaded()) { return; } $this->containingPackage = $this->mapping->getContainingPackage(); // Remember the conflicts that will be adjusted during unload() foreach ($this->mapping->getConflicts() as $conflict) { $this->conflicts[$conflict->getRepositoryPath()] = $conflict; $this->conflictingMappings[$conflict->getRepositoryPath()] = $conflict->getMappings(); } $packageName = $this->containingPackage->getName(); $this->mappings->remove($this->mapping->getRepositoryPath(), $packageName); foreach ($this->mapping->listRepositoryPaths() as $repositoryPath) { $this->mappingsByResource->remove($repositoryPath, $packageName); $this->conflictDetector->release($repositoryPath, $packageName); } // Unload after iterating, otherwise the paths are gone $this->mapping->unload(); }
/** * {@inheritdoc} */ public function rollback() { if (!$this->mapping->isLoaded()) { return; } $packageName = $this->containingPackage->getName(); $this->mappings->remove($this->mapping->getRepositoryPath(), $packageName); foreach ($this->mapping->listRepositoryPaths() as $repositoryPath) { $this->mappingsByResource->remove($repositoryPath, $packageName); $this->conflictDetector->release($repositoryPath, $packageName); } // Unload after iterating, otherwise the paths are gone $this->mapping->unload(); }