|
@@ -464,7 +464,7 @@ class Zend_Loader_PluginLoaderTest extends PHPUnit_Framework_TestCase
|
|
|
require_once 'Zend/View/Helper/DeclareVars.php';
|
|
require_once 'Zend/View/Helper/DeclareVars.php';
|
|
|
$reflection = new ReflectionClass('Zend_View_Helper_DeclareVars');
|
|
$reflection = new ReflectionClass('Zend_View_Helper_DeclareVars');
|
|
|
$expected = $reflection->getFileName();
|
|
$expected = $reflection->getFileName();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$loader = new Zend_Loader_PluginLoader(array());
|
|
$loader = new Zend_Loader_PluginLoader(array());
|
|
|
$loader->addPrefixPath('Zend_View_Helper', $this->libPath . '/Zend/View/Helper');
|
|
$loader->addPrefixPath('Zend_View_Helper', $this->libPath . '/Zend/View/Helper');
|
|
|
$loader->addPrefixPath('ZfTest', dirname(__FILE__) . '/_files/ZfTest');
|
|
$loader->addPrefixPath('ZfTest', dirname(__FILE__) . '/_files/ZfTest');
|
|
@@ -475,7 +475,7 @@ class Zend_Loader_PluginLoaderTest extends PHPUnit_Framework_TestCase
|
|
|
$paths = $loader->getPaths();
|
|
$paths = $loader->getPaths();
|
|
|
$this->fail(sprintf("Failed loading helper; paths: %s", var_export($paths, 1)));
|
|
$this->fail(sprintf("Failed loading helper; paths: %s", var_export($paths, 1)));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$classPath = $loader->getClassPath('DeclareVars');
|
|
$classPath = $loader->getClassPath('DeclareVars');
|
|
|
$this->assertContains($expected, $classPath);
|
|
$this->assertContains($expected, $classPath);
|
|
|
}
|
|
}
|
|
@@ -500,6 +500,22 @@ class Zend_Loader_PluginLoaderTest extends PHPUnit_Framework_TestCase
|
|
|
$this->assertEquals('Zfns\\Foo', $className);
|
|
$this->assertEquals('Zfns\\Foo', $className);
|
|
|
$this->assertEquals('Zfns\\Foo', $loader->getClassName('Foo'));
|
|
$this->assertEquals('Zfns\\Foo', $loader->getClassName('Foo'));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @group ZF-9721
|
|
|
|
|
+ */
|
|
|
|
|
+ public function testRemovePrefixPathThrowsExceptionIfPathNotRegisteredInPrefix()
|
|
|
|
|
+ {
|
|
|
|
|
+ try {
|
|
|
|
|
+ $loader = new Zend_Loader_PluginLoader(array('My_Namespace_' => 'My/Namespace/'));
|
|
|
|
|
+ $loader->removePrefixPath('My_Namespace_', 'ZF9721');
|
|
|
|
|
+ $this->fail();
|
|
|
|
|
+ } catch (Exception $e) {
|
|
|
|
|
+ $this->assertType('Zend_Loader_PluginLoader_Exception', $e);
|
|
|
|
|
+ $this->assertContains('Prefix My_Namespace_ / Path ZF9721', $e->getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ $this->assertEquals(1, count($loader->getPaths('My_Namespace_')));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Call Zend_Loader_PluginLoaderTest::main() if this source file is executed directly.
|
|
// Call Zend_Loader_PluginLoaderTest::main() if this source file is executed directly.
|