Merge branch '2.8'
* 2.8: test legacy CSRF configuration options
This commit is contained in:
commit
380ce606aa
@ -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