getLoadErrors() public method

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
public getLoadErrors ( ) : Exceptio\Exception[]
return Exceptio\Exception[] The errors that occurred during loading. If the returned array is empty, the mapping was loaded successfully.
 private function assertNoLoadErrors(PathMapping $mapping)
 {
     $loadErrors = $mapping->getLoadErrors();
     if (count($loadErrors) > 0) {
         // Rethrow first error
         throw reset($loadErrors);
     }
 }
示例#2
0
 public function testLoadStoresErrorIfPackageNotFound()
 {
     $mapping = new PathMapping('/path', array('@foo:resources', 'assets'));
     $mapping->load($this->package1, $this->packages);
     $this->assertSame(array('@foo:resources', 'assets'), $mapping->getPathReferences());
     $this->assertSame(array($this->packageDir1 . '/assets'), $mapping->getFilesystemPaths());
     // there's at least one found path, so the mapping is still enabled
     $this->assertTrue($mapping->isEnabled());
     $loadErrors = $mapping->getLoadErrors();
     $this->assertCount(1, $loadErrors);
     $this->assertInstanceOf('Puli\\Manager\\Api\\Package\\NoSuchPackageException', $loadErrors[0]);
 }