コード例 #1
0
ファイル: PluginLoaderTest.php プロジェクト: omusico/logica
 /**
  * @group ZF-4697
  */
 public function testClassFilesGrabCorrectPathForLoadedClasses()
 {
     require_once 'Zend/View/Helper/DeclareVars.php';
     $reflection = new ReflectionClass('Zend_View_Helper_DeclareVars');
     $expected = $reflection->getFileName();
     $loader = new Zend_Loader_PluginLoader(array());
     $loader->addPrefixPath('Zend_View_Helper', $this->libPath . '/Zend/View/Helper');
     $loader->addPrefixPath('ZfTest', dirname(__FILE__) . '/_files/ZfTest');
     try {
         // Class in /Zend/View/Helper and not in /_files/ZfTest
         $className = $loader->load('DeclareVars');
     } catch (Exception $e) {
         $paths = $loader->getPaths();
         $this->fail(sprintf("Failed loading helper; paths: %s", var_export($paths, 1)));
     }
     $classPath = $loader->getClassPath('DeclareVars');
     $this->assertContains($expected, $classPath);
 }