From 71ff965013dc86c1200dcf53de69d2594b696123 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 --- .../Bundle/FrameworkBundle/CHANGELOG.md | 1 + .../DependencyInjection/ConfigurationTest.php | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 9b9fdecee5bb0..d879f989d8551 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -12,6 +12,7 @@ CHANGELOG PHP's native `serialize()` and `unserialize()` functions. To use the original serialization method, set the `framework.messenger.serializer.id` config option to `messenger.transport.symfony_serializer`. + * Allow hyphens in assets packages names. 4.2.0 ----- diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index d8acb04909809..1727d3bc627d6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -101,6 +101,35 @@ public function testAssetsCanBeEnabled() $this->assertEquals($defaultConfig, $config['assets']); } + /** + * @dataProvider provideValidAssetsPackageNameConfigurationTests + */ + public function testValidAssetsPackageNameConfiguration(string $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 */