Source of file RecaptchaFieldFunctionalTestController.php
Size: 1,136 Bytes - Last Modified: 2021-12-23T10:33:45+00:00
/var/www/docs.ssmods.com/process/src/tests/RecaptchaFieldFunctionalTestController.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445 | <?php namespace SilverStripe\Recaptcha\Tests; use SilverStripe\Control\Controller; use SilverStripe\Dev\TestOnly; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\Form; use SilverStripe\Forms\FormAction; use SilverStripe\Recaptcha\RecaptchaField; /** * Class RecaptchaFieldFunctionalTestController * * @package recaptcha */ class RecaptchaFieldFunctionalTestController extends Controller implements TestOnly { private static $allowed_actions = [ 'Form' ]; protected $template = 'BlankPage'; private static $url_segment = 'RecaptchaFieldFunctionalTest_Controller'; public function Link($action = null) { return Controller::join_links('RecaptchaFieldFunctionalTest_Controller', $action); } public function Form() { $form = Form::create($this, 'Form', FieldList::create($f = RecaptchaField::create('MyRecaptchaField')), FieldList::create(FormAction::create('doSubmit', 'submit'))); $f->setHTTPClient(new RecaptchaFieldTestHttpClient()); return $form; } public function doSubmit($data, $form) { return 'submitted'; } } |