diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index f59ad4e5b3240..fa3c105e6f939 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -558,7 +558,7 @@ private function createUserProviders($config, ContainerBuilder $container) // Parses a tag and returns the id for the related user provider service private function createUserDaoProvider($name, $provider, ContainerBuilder $container) { - $name = $this->getUserProviderId(strtolower($name)); + $name = $this->getUserProviderId($name); // Doctrine Entity and In-memory DAO provider are managed by factories foreach ($this->userProviderFactories as $factory) { @@ -582,7 +582,7 @@ private function createUserDaoProvider($name, $provider, ContainerBuilder $conta if (isset($provider['chain'])) { $providers = array(); foreach ($provider['chain']['providers'] as $providerName) { - $providers[] = new Reference($this->getUserProviderId(strtolower($providerName))); + $providers[] = new Reference($this->getUserProviderId($providerName)); } $container @@ -597,7 +597,7 @@ private function createUserDaoProvider($name, $provider, ContainerBuilder $conta private function getUserProviderId($name) { - return 'security.user.provider.concrete.'.$name; + return 'security.user.provider.concrete.'.strtolower($name); } private function createExceptionListener($container, $config, $id, $defaultEntryPoint, $stateless) diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CamelCasedProviders/bundles.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CamelCasedProviders/bundles.php new file mode 100644 index 0000000000000..86614bdb891de --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CamelCasedProviders/bundles.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array( + new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), + new Symfony\Bundle\SecurityBundle\SecurityBundle(), + new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), +); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CamelCasedProviders/config.yml b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CamelCasedProviders/config.yml new file mode 100644 index 0000000000000..0b21534ecf420 --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CamelCasedProviders/config.yml @@ -0,0 +1,30 @@ +imports: + - { resource: ./../config/framework.yml } + +doctrine: + dbal: + driver: pdo_sqlite + memory: true + charset: UTF8 + + orm: + entity_managers: + default: + + auto_mapping: true + +security: + providers: + camelCasedName: + entity: + class: Symfony\Component\Security\Core\User\User + + firewalls: + default: + anonymous: ~ + provider: camelCasedName + + encoders: + Symfony\Component\Security\Core\User\User: plaintext + + diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CamelCasedProvidersCausesExceptionsTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CamelCasedProvidersCausesExceptionsTest.php new file mode 100644 index 0000000000000..41db3338da97d --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CamelCasedProvidersCausesExceptionsTest.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\SecurityBundle\Tests\Functional; + +class CamelCasedProvidersCausesExceptionsTest extends WebTestCase +{ + public function testBugfixExceptionThenCamelCasedProviderIsGiven() + { + $client = $this->createClient(array('test_case' => 'CamelCasedProviders', 'root_config' => 'config.yml')); + } +}