/**
* Test that the configuration options work.
*
* @return void
* @triggers Controller.startup $controller
*/
public function testConfigurationValidate()
{
$_SERVER['REQUEST_METHOD'] = 'POST';
$controller = $this->getMock('Cake\\Controller\\Controller', ['redirect']);
$controller->request = new Request(['cookies' => ['csrfToken' => 'nope', 'token' => 'yes'], 'post' => ['_csrfToken' => 'no match', 'token' => 'yes']]);
$controller->response = new Response();
$component = new CsrfComponent($this->registry, ['cookieName' => 'token', 'field' => 'token', 'expiry' => 90]);
$event = new Event('Controller.startup', $controller);
$result = $component->startup($event);
$this->assertNull($result, 'Config settings should work.');
}