public function SmsFrameworkPhoneNumberVerifyForm::testVerifyFormFlood in SMS Framework 2.1.x
Same name and namespace in other branches
- 8 tests/src/Functional/SmsFrameworkPhoneNumberVerifyForm.php \Drupal\Tests\sms\Functional\SmsFrameworkPhoneNumberVerifyForm::testVerifyFormFlood()
- 2.x tests/src/Functional/SmsFrameworkPhoneNumberVerifyForm.php \Drupal\Tests\sms\Functional\SmsFrameworkPhoneNumberVerifyForm::testVerifyFormFlood()
Test phone number verification form.
File
- tests/
src/ Functional/ SmsFrameworkPhoneNumberVerifyForm.php, line 79
Class
- SmsFrameworkPhoneNumberVerifyForm
- Tests phone numbers verification code form.
Namespace
Drupal\Tests\sms\FunctionalCode
public function testVerifyFormFlood() {
// Reduce number of POST requests. Number isn't important.
\Drupal::configFactory()
->getEditable('sms.settings')
->set('flood.verify_limit', 1)
->save();
$account = $this
->drupalCreateUser([
'sms verify phone number',
]);
$this
->drupalLogin($account);
$edit['code'] = $this
->randomMachineName();
$this
->drupalPostForm(Url::fromRoute('sms.phone.verify'), $edit, t('Verify code'));
$this
->assertNoText(t('There has been too many failed verification attempts. Try again later.'));
$this
->drupalPostForm(Url::fromRoute('sms.phone.verify'), $edit, t('Verify code'));
$this
->assertText(t('There has been too many failed verification attempts. Try again later.'));
}