/** * Boots the Bundle. */ public function boot() { if ($this->container->hasParameter('csrf_secret')) { Form::setDefaultCsrfSecret($this->container->getParameter('csrf_secret')); Form::enableDefaultCsrfProtection(); } }
public function testDefaultCsrfSecretCanBeSet() { Form::setDefaultCsrfSecret('foobar'); $form = new Form('author', new Author(), $this->validator); $form->enableCsrfProtection(); $this->assertEquals('foobar', $form->getCsrfSecret()); }