|
|
@@ -2202,6 +2202,36 @@ class Zend_Form_ElementTest extends PHPUnit_Framework_TestCase
|
|
|
$validator = $username->getValidator('regex');
|
|
|
$this->assertTrue($validator->zfBreakChainOnFailure);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @group ZF-12173
|
|
|
+ */
|
|
|
+ public function testCanAddPluginLoaderPrefixPathsWithBackslashes()
|
|
|
+ {
|
|
|
+ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
|
|
|
+ $this->markTestSkipped(__CLASS__ . '::' . __METHOD__ . ' requires PHP 5.3.0 or greater');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $validatorLoader = new Zend_Loader_PluginLoader();
|
|
|
+ $filterLoader = new Zend_Loader_PluginLoader();
|
|
|
+ $decoratorLoader = new Zend_Loader_PluginLoader();
|
|
|
+ $this->element->setPluginLoader($validatorLoader, 'validate')
|
|
|
+ ->setPluginLoader($filterLoader, 'filter')
|
|
|
+ ->setPluginLoader($decoratorLoader, 'decorator')
|
|
|
+ ->addPrefixPath('Zf\Foo', 'Zf/Foo');
|
|
|
+
|
|
|
+ $paths = $filterLoader->getPaths('Zf\Foo\Filter');
|
|
|
+ $this->assertTrue(is_array($paths));
|
|
|
+ $this->assertContains('Filter', $paths[0]);
|
|
|
+
|
|
|
+ $paths = $validatorLoader->getPaths('Zf\Foo\Validate');
|
|
|
+ $this->assertTrue(is_array($paths));
|
|
|
+ $this->assertContains('Validate', $paths[0]);
|
|
|
+
|
|
|
+ $paths = $decoratorLoader->getPaths('Zf\Foo\Decorator');
|
|
|
+ $this->assertTrue(is_array($paths), var_export($paths, 1));
|
|
|
+ $this->assertContains('Decorator', $paths[0]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class Zend_Form_ElementTest_Decorator extends Zend_Form_Decorator_Abstract
|