public function testConstructor() { $loader = new ClassLoader(); $loader->addPrefix('Apc\\Namespaced', __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures'); $loader = new ApcClassLoader('test.prefix.', $loader); $this->assertEquals($loader->findFile('\\Apc\\Namespaced\\FooBar'), apcu_fetch('test.prefix.\\Apc\\Namespaced\\FooBar'), '__construct() takes a prefix as its first argument'); }
/** * @dataProvider getLoaderTests */ public function testFindFile($className, $location) { $loader = new ApcClassLoader(md5(__DIR__), new Nsautoload()); $file = $loader->findFile($className); $this->assertSame(realpath($file), realpath($location)); }