From 5c58b6e8759c595dc53899d55b1e6c86547d2582 Mon Sep 17 00:00:00 2001 From: Anthony MARTIN Date: Mon, 28 Jan 2019 14:09:39 +0100 Subject: [PATCH] Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR --- .../DependencyInjection/ConfigurationTest.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 1be4015713dc..91764a642e8d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -211,6 +211,35 @@ public function testAssetsCanBeEnabled() $this->assertEquals($defaultConfig, $config['assets']); } + /** + * @dataProvider provideValidAssetsPackageNameConfigurationTests + */ + public function testValidAssetsPackageNameConfiguration($packageName) + { + $processor = new Processor(); + $configuration = new Configuration(true); + $config = $processor->processConfiguration($configuration, [ + [ + 'assets' => [ + 'packages' => [ + $packageName => [], + ], + ], + ], + ]); + + $this->assertArrayHasKey($packageName, $config['assets']['packages']); + } + + public function provideValidAssetsPackageNameConfigurationTests() + { + return [ + ['foobar'], + ['foo-bar'], + ['foo_bar'], + ]; + } + /** * @dataProvider provideInvalidAssetConfigurationTests */