Remove the is_dir check from the ClassLoader

refs #5786
This commit is contained in:
Eric Lippmann 2015-08-18 09:32:00 +02:00
parent 5ecde41ba3
commit 234dc951d2
2 changed files with 0 additions and 18 deletions

View File

@ -29,18 +29,9 @@ class ClassLoader
* @param string $directory * @param string $directory
* *
* @return $this * @return $this
* @throws ProgrammingError
*/ */
public function registerNamespace($namespace, $directory) public function registerNamespace($namespace, $directory)
{ {
if (!is_dir($directory)) {
throw new ProgrammingError(
'Directory "%s" for namespace "%s" does not exist',
$directory,
$namespace
);
}
$this->namespaces[$namespace] = $directory; $this->namespaces[$namespace] = $directory;
return $this; return $this;

View File

@ -107,13 +107,4 @@ EOD;
$o = new \My\Library\TestStruct(); $o = new \My\Library\TestStruct();
$this->assertTrue($o->testFlag()); $this->assertTrue($o->testFlag());
} }
/**
* @expectedException Icinga\Exception\ProgrammingError
*/
public function testNonexistingDirectory()
{
$loader = new ClassLoader();
$loader->registerNamespace('My\\Library', '/trullalla/123');
}
} }