addRootPathMapping() public method

public addRootPathMapping ( PathMapping $mapping, $flags )
$mapping Puli\Manager\Api\Repository\PathMapping
 public function testAddRootPathMappingRemovesNewConflictsIfSavingFails()
 {
     $this->initDefaultManager();
     $mapping = new PathMapping('/path', 'resources');
     $this->packageFile1->addPathMapping($existing = new PathMapping('/path', 'resources'));
     $this->repo->expects($this->at(0))->method('add')->with('/path', new DirectoryResource($this->rootDir . '/resources'));
     $this->repo->expects($this->at(1))->method('remove')->with('/path');
     $this->repo->expects($this->at(2))->method('add')->with('/path', new DirectoryResource($this->packageDir1 . '/resources'));
     $this->packageFileStorage->expects($this->once())->method('saveRootPackageFile')->willThrowException(new TestException('Cannot save'));
     try {
         $this->manager->addRootPathMapping($mapping);
         $this->fail('Expected a TestException');
     } catch (TestException $e) {
     }
     $this->assertTrue($existing->isEnabled());
     $this->assertFalse($mapping->isLoaded());
 }