Commit c5dc42a7 authored by Pascal Luna's avatar Pascal Luna

Fixed translator.resources definition

parent 74d9869d
...@@ -80,9 +80,9 @@ class TranslationServiceProvider implements ServiceProviderInterface, EventListe ...@@ -80,9 +80,9 @@ class TranslationServiceProvider implements ServiceProviderInterface, EventListe
return new MessageSelector(); return new MessageSelector();
}; };
$app['translator.resources'] = $app->protect(function ($app) { $app['translator.resources'] = function ($app) {
return array(); return array();
}); };
$app['translator.domains'] = array(); $app['translator.domains'] = array();
$app['locale_fallbacks'] = array('en'); $app['locale_fallbacks'] = array('en');
......
...@@ -82,7 +82,7 @@ class ValidatorServiceProviderTest extends TestCase ...@@ -82,7 +82,7 @@ class ValidatorServiceProviderTest extends TestCase
*/ */
public function testValidatorServiceIsAValidator($app) public function testValidatorServiceIsAValidator($app)
{ {
$this->assertTrue($app['validator'] instanceof ValidatorInterface || $app['validator'] instanceof LegacyValidatorInterface ); $this->assertTrue($app['validator'] instanceof ValidatorInterface || $app['validator'] instanceof LegacyValidatorInterface);
} }
/** /**
...@@ -192,4 +192,15 @@ class ValidatorServiceProviderTest extends TestCase ...@@ -192,4 +192,15 @@ class ValidatorServiceProviderTest extends TestCase
$this->assertEquals('Pas vide', $app['translator']->trans('This value should not be blank.', array(), 'validators', 'fr')); $this->assertEquals('Pas vide', $app['translator']->trans('This value should not be blank.', array(), 'validators', 'fr'));
} }
public function testTranslatorResourcesIsArray()
{
$app = new Application();
$app['locale'] = 'fr';
$app->register(new ValidatorServiceProvider());
$app->register(new TranslationServiceProvider());
$this->assertInternalType('array', $app['translator.resources']);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment