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