Puli\Manager\Api\Repository\PathMapping::isNotFound PHP Method

isNotFound() public method

The method {@link load()} needs to be called before calling this method, otherwise an exception is thrown.
See also: PathMappingState::NOT_FOUND
public isNotFound ( ) : boolean
return boolean Returns `true` if the state is {@link PathMappingState::NOT_FOUND}.
    public function isNotFound()
    {
        if (null === $this->state) {
            throw new NotLoadedException('The mapping is not loaded.');
        }
        return PathMappingState::NOT_FOUND === $this->state;
    }

Usage Example

Beispiel #1
0
 public function testLoadStoresErrorsIfNoPathFound()
 {
     $mapping = new PathMapping('/path', array('foo', 'bar'));
     $mapping->load($this->package1, $this->packages);
     $this->assertSame(array('foo', 'bar'), $mapping->getPathReferences());
     $this->assertSame(array(), $mapping->getFilesystemPaths());
     // no found path, not enabled
     $this->assertFalse($mapping->isEnabled());
     $this->assertTrue($mapping->isNotFound());
     $loadErrors = $mapping->getLoadErrors();
     $this->assertCount(2, $loadErrors);
     $this->assertInstanceOf('Puli\\Manager\\Api\\FileNotFoundException', $loadErrors[0]);
     $this->assertInstanceOf('Puli\\Manager\\Api\\FileNotFoundException', $loadErrors[1]);
 }