| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function testEnableSpamProtection() |
||
| 26 | { |
||
| 27 | Config::modify()->set( |
||
| 28 | FormSpamProtectionExtension::class, |
||
| 29 | 'default_spam_protector', |
||
| 30 | HCaptchaProtector::class |
||
| 31 | ); |
||
| 32 | |||
| 33 | $form = Form::create(Controller::create(), 'Form', FieldList::create( |
||
| 34 | TextField::create('Title'), |
||
| 35 | TextField::create('Comment') |
||
| 36 | ), FieldList::create()); |
||
| 37 | |||
| 38 | $form->disableSecurityToken(); |
||
| 39 | |||
| 40 | $form = $form->enableSpamProtection(); |
||
| 41 | |||
| 42 | $this->assertNotNull($form->Fields()->fieldByName('Captcha')); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |