diff --git a/src/Translator/LoaderPluginManager.php b/src/Translator/LoaderPluginManager.php index d3116965..2becb8ca 100644 --- a/src/Translator/LoaderPluginManager.php +++ b/src/Translator/LoaderPluginManager.php @@ -58,8 +58,12 @@ class LoaderPluginManager extends AbstractPluginManager { protected $aliases = [ 'gettext' => Loader\Gettext::class, + 'getText' => Loader\Gettext::class, + 'GetText' => Loader\Gettext::class, 'ini' => Loader\Ini::class, - 'phparray' => Loader\PhpArray::class + 'phparray' => Loader\PhpArray::class, + 'phpArray' => Loader\PhpArray::class, + 'PhpArray' => Loader\PhpArray::class, ]; protected $factories = [ diff --git a/test/Translator/LoaderPluginManagerFactoryTest.php b/test/Translator/LoaderPluginManagerFactoryTest.php index 27eed370..f975baf6 100644 --- a/test/Translator/LoaderPluginManagerFactoryTest.php +++ b/test/Translator/LoaderPluginManagerFactoryTest.php @@ -38,26 +38,44 @@ public function testCreateServiceReturnsUnconfiguredPluginManagerWhenNoOptionsPr $this->assertFalse($loaders->has('test')); } - public function testFactoryCanConfigurePluginManagerViaOptions() + public function provideLoader() + { + return [ + ['gettext'], + ['getText'], + ['GetText'], + ['phparray'], + ['phpArray'], + ['PhpArray'], + ]; + } + + /** + * @dataProvider provideLoader + */ + public function testFactoryCanConfigurePluginManagerViaOptions($loader) { $container = $this->prophesize(ContainerInterface::class)->reveal(); $factory = new LoaderPluginManagerFactory(); $loaders = $factory($container, 'TranslatorPluginManager', ['aliases' => [ - 'test' => 'phparray', + 'test' => $loader, ]]); $this->assertInstanceOf(LoaderPluginManager::class, $loaders); $this->assertTrue($loaders->has('test')); } - public function testCreateServiceCanConfigurePluginManagerViaOptions() + /** + * @dataProvider provideLoader + */ + public function testCreateServiceCanConfigurePluginManagerViaOptions($loader) { $container = $this->prophesize(ServiceLocatorInterface::class); $container->willImplement(ContainerInterface::class); $factory = new LoaderPluginManagerFactory(); $factory->setCreationOptions(['aliases' => [ - 'test' => 'phparray', + 'test' => $loader, ]]); $loaders = $factory->createService($container->reveal()); $this->assertInstanceOf(LoaderPluginManager::class, $loaders);