Skip to content

Commit af45be7

Browse files
committed
Merge branch '7.2' into 7.3
* 7.2: rewrite tests to not fail when self/parent are resolved at compile time skip failing Semaphore component tests on GitHub Actions with PHP 8.5 Update GetSetMethodNormalizer.php [FrameworkBundle] Disable the keys normalization of the CSRF form field attributes [Stopwatch] Fix StopWatchEvent never throws InvalidArgumentException
2 parents 7aff669 + 53cad5c commit af45be7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ private function addFormSection(ArrayNodeDefinition $rootNode, callable $enableI
253253
->scalarNode('field_name')->defaultValue('_token')->end()
254254
->arrayNode('field_attr')
255255
->performNoDeepMerging()
256+
->normalizeKeys(false)
256257
->scalarPrototype()->end()
257258
->defaultValue(['data-controller' => 'csrf-protection'])
258259
->end()

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,22 @@ public function testSerializerJsonDetailedErrorMessagesNotSetByDefaultWithDebugD
706706
$this->assertSame([], $config['serializer']['default_context'] ?? []);
707707
}
708708

709+
public function testFormCsrfProtectionFieldAttrDoNotNormalizeKeys()
710+
{
711+
$processor = new Processor();
712+
$config = $processor->processConfiguration(new Configuration(false), [
713+
[
714+
'form' => [
715+
'csrf_protection' => [
716+
'field_attr' => ['data-example-attr' => 'value'],
717+
],
718+
],
719+
],
720+
]);
721+
722+
$this->assertSame(['data-example-attr' => 'value'], $config['form']['csrf_protection']['field_attr'] ?? []);
723+
}
724+
709725
protected static function getBundleDefaultConfig()
710726
{
711727
return [

0 commit comments

Comments
 (0)