Skip to content

Commit 380ce60

Browse files
Merge branch '2.8'
* 2.8: test legacy CSRF configuration options
2 parents ba3afdb + 953ed3c commit 380ce60

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,32 @@ public function testCsrfAliases()
9191
$this->assertEquals('a_token_id', $processedConfig['firewalls']['stub']['logout']['csrf_token_id']);
9292
}
9393

94+
/**
95+
* @group legacy
96+
*/
97+
public function testLegacyCsrfAliases()
98+
{
99+
$config = array(
100+
'firewalls' => array(
101+
'stub' => array(
102+
'logout' => array(
103+
'csrf_provider' => 'a_token_generator',
104+
'intention' => 'a_token_id',
105+
),
106+
),
107+
),
108+
);
109+
$config = array_merge(static::$minimalConfig, $config);
110+
111+
$processor = new Processor();
112+
$configuration = new MainConfiguration(array(), array());
113+
$processedConfig = $processor->processConfiguration($configuration, array($config));
114+
$this->assertTrue(isset($processedConfig['firewalls']['stub']['logout']['csrf_token_generator']));
115+
$this->assertEquals('a_token_generator', $processedConfig['firewalls']['stub']['logout']['csrf_token_generator']);
116+
$this->assertTrue(isset($processedConfig['firewalls']['stub']['logout']['csrf_token_id']));
117+
$this->assertEquals('a_token_id', $processedConfig['firewalls']['stub']['logout']['csrf_token_id']);
118+
}
119+
94120
/**
95121
* @expectedException \InvalidArgumentException
96122
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy