Fix #1260 : Prefix plugin twig namespace with "plugin-"

This commit is contained in:
Romain Neutron
2013-07-09 15:26:17 +02:00
parent 1dbb225696
commit b099e42012
2 changed files with 3 additions and 3 deletions

View File

@@ -153,13 +153,13 @@ return array(
EOF;
foreach ($manifests as $manifest) {
$name = $this->quote($manifest->getName());
$namespace = $this->quote('plugin-' . $manifest->getName());
$path = $this->pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'views';
if (is_dir($path)) {
$path = $this->quote($path);
$buffer .= <<<EOF
$name => $path,
$namespace => $path,
EOF;
}

View File

@@ -63,7 +63,7 @@ class AutoloaderGeneratorTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf('Vendor\CustomCommand', $cli['console']->find('hello:world'));
$mapping = require $pluginsDir . '/twig-paths.php';
$this->assertSame(array('TestPlugin' => $pluginsDir . '/TestPlugin/views', $pluginsDir . '/TestPlugin/views', $pluginsDir . '/TestPlugin/twig-views'), $mapping);
$this->assertSame(array('plugin-TestPlugin' => $pluginsDir . '/TestPlugin/views', $pluginsDir . '/TestPlugin/views', $pluginsDir . '/TestPlugin/twig-views'), $mapping);
$this->cleanup($files);
}