diff --git a/tests/Zend/Loader/PluginLoaderTest.php b/tests/Zend/Loader/PluginLoaderTest.php index 567a51c..3e9a8af 100644 --- a/tests/Zend/Loader/PluginLoaderTest.php +++ b/tests/Zend/Loader/PluginLoaderTest.php @@ -510,6 +510,25 @@ class Zend_Loader_PluginLoaderTest extends PHPUnit_Framework_TestCase } $this->assertEquals(1, count($loader->getPaths('My_Namespace_'))); } + + /** + * @group ZF-11330 + */ + public function testLoadClassesWithBackslashInName() + { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + $this->markTestSkipped(__CLASS__ . '::' . __METHOD__ . ' requires PHP 5.3.0 or greater'); + return; + } + $loader = new Zend_Loader_PluginLoader(array()); + $loader->addPrefixPath('Zfns\\', dirname(__FILE__) . '/_files/Zfns'); + try { + $className = $loader->load('Foo\\Bar'); + } catch (Exception $e) { + $this->fail(sprintf("Failed loading helper with backslashes in name")); + } + $this->assertEquals('Zfns\\Foo\\Bar', $className); + } } // Call Zend_Loader_PluginLoaderTest::main() if this source file is executed directly. diff --git a/tests/Zend/Loader/_files/ZendLoaderAutoloader/Foo/Bar.php b/tests/Zend/Loader/_files/ZendLoaderAutoloader/Foo/Bar.php new file mode 100644 index 0000000..5d0ced5 --- /dev/null +++ b/tests/Zend/Loader/_files/ZendLoaderAutoloader/Foo/Bar.php @@ -0,0 +1,33 @@ + +