public function testMake()
 {
     $loader = AutoloaderFactory::make();
     $this->assertInstanceOf(ClassLoader::CLASS, $loader);
     $reflection = new ReflectionProperty($loader, 'isRegistered');
     $reflection->setAccessible(true);
     $this->assertTrue($reflection->getValue($loader));
     $second = AutoloaderFactory::make();
     $this->assertSame($loader, $second);
 }
Пример #2
0
 public function testFindFileReturnPathToFileIfFileFound()
 {
     $loader = \Es\Loader\AutoloaderFactory::make();
     $prefix = 'Es\\Loader\\Test\\Files\\Foo';
     $class = 'Es\\Loader\\Test\\Files\\Foo\\SomeClass';
     $path = __DIR__ . PHP_DS . 'files' . PHP_DS . 'Foo' . PHP_DS . 'src' . PHP_DS;
     $file = $path . 'SomeClass.php';
     $loader->registerPath($prefix, $path);
     $this->assertEquals($loader->findFile($class), $file);
 }