Fixup Service Instantiation and enforce application booting.

This commit is contained in:
Benoît Burnichon
2015-11-03 10:54:06 +01:00
parent 27bd211b0e
commit 38eab1f97e
2 changed files with 10 additions and 8 deletions

View File

@@ -87,14 +87,6 @@ class PluginServiceProvider implements ServiceProviderInterface
// Add a new controller provider can be added as follows
// $app['plugin.controller_providers'][] = array('/prefix', 'controller_provider_service_key');
$app['plugin.controller_providers.api'] = new ArrayObject();
}
public function boot(Application $app)
{
foreach ($app['plugin.locale.textdomains'] as $textdomain => $dir) {
bind_textdomain_codeset($textdomain, 'UTF-8');
bindtextdomain($textdomain, $dir);
}
$app['twig'] = $app->share(
$app->extend('twig', function (Twig_Environment $twig) {
@@ -105,4 +97,12 @@ class PluginServiceProvider implements ServiceProviderInterface
})
);
}
public function boot(Application $app)
{
foreach ($app['plugin.locale.textdomains'] as $textdomain => $dir) {
bind_textdomain_codeset($textdomain, 'UTF-8');
bindtextdomain($textdomain, $dir);
}
}
}

View File

@@ -14,6 +14,8 @@ class module_console_systemTemplateGeneratorTest extends \PhraseanetTestCase
{
$application = new CLI('test', null, 'test');
$application->command(new module_console_systemTemplateGenerator('system:templateGenerator'));
// Application should be booted before executing commands
$application->boot();
$command = $application['console']->find('system:templateGenerator');
$commandTester = new CommandTester($command);