minor #16718 [SecurityBundle] test legacy CSRF configuration options (xabbuh)
This PR was merged into the 2.8 branch.
Discussion
----------
[SecurityBundle] test legacy CSRF configuration options
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #16704
| License | MIT
| Doc PR |
Commits
-------
444b6ef
test legacy CSRF configuration options
This commit is contained in:
commit
953ed3c28c
@ -91,6 +91,32 @@ class MainConfigurationTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals('a_token_id', $processedConfig['firewalls']['stub']['logout']['csrf_token_id']);
|
$this->assertEquals('a_token_id', $processedConfig['firewalls']['stub']['logout']['csrf_token_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group legacy
|
||||||
|
*/
|
||||||
|
public function testLegacyCsrfAliases()
|
||||||
|
{
|
||||||
|
$config = array(
|
||||||
|
'firewalls' => array(
|
||||||
|
'stub' => array(
|
||||||
|
'logout' => array(
|
||||||
|
'csrf_provider' => 'a_token_generator',
|
||||||
|
'intention' => 'a_token_id',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
$config = array_merge(static::$minimalConfig, $config);
|
||||||
|
|
||||||
|
$processor = new Processor();
|
||||||
|
$configuration = new MainConfiguration(array(), array());
|
||||||
|
$processedConfig = $processor->processConfiguration($configuration, array($config));
|
||||||
|
$this->assertTrue(isset($processedConfig['firewalls']['stub']['logout']['csrf_token_generator']));
|
||||||
|
$this->assertEquals('a_token_generator', $processedConfig['firewalls']['stub']['logout']['csrf_token_generator']);
|
||||||
|
$this->assertTrue(isset($processedConfig['firewalls']['stub']['logout']['csrf_token_id']));
|
||||||
|
$this->assertEquals('a_token_id', $processedConfig['firewalls']['stub']['logout']['csrf_token_id']);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user