Example #1
0
 public function testDefaultCsrfSecretCanBeSet()
 {
     Form::setDefaultCsrfSecret('foobar');
     $form = new Form('author', new Author(), $this->validator);
     $form->enableCsrfProtection();
     $this->assertEquals('foobar', $form->getCsrfSecret());
 }
Example #2
0
 public function testGeneratedCsrfSecretByDefault()
 {
     $form = new Form('author', new Author(), $this->validator);
     $form->enableCsrfProtection();
     $this->assertTrue(strlen($form->getCsrfSecret()) >= 32);
 }