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