$this->assertSession()->pageTextNotContains($this->t('Access denied'),'Admin users should be able to access the Friendlycaptcha admin page','Friendlycaptcha');
$this->assertSession()->responseContains($this->t('The configuration options have been saved.'),'[testFriendlycaptchaAdminSettingsForm]: The configuration options have been saved.');
$this->assertSession()->responseContains($this->t('The configuration options have been saved.'));
$this->assertSession()->responseNotContains($this->t('Site key field is required.'),'[testFriendlycaptchaAdminSettingsForm]: Site key was not empty.');
$this->assertSession()->responseNotContains($this->t('Secret key field is required.'),'[testFriendlycaptchaAdminSettingsForm]: Secret key was not empty.');
$this->assertSession()->responseNotContains($this->t('The tabindex must be an integer.'),'[testFriendlycaptchaAdminSettingsForm]: Tab index had a valid input.');
$this->assertSession()->responseNotContains($this->t('Site key field is required.'));
$this->assertSession()->responseNotContains($this->t('Secret key field is required.'));
$this->assertSession()->responseNotContains($this->t('The tabindex must be an integer.'));
$this->drupalLogout();
}
@@ -145,27 +146,27 @@ class FriendlyCaptchaBasicTest extends BrowserTestBase {
$this->drupalLogout();
$this->drupalGet('user/login');
$this->assertSession()->responseNotContains($friendlyCaptchaHtml,'[testFriendlycaptchaOnLoginForm]: Friendlycaptcha is not shown on form.');
$this->assertSession()->responseNotContains($friendlyCaptchaNoScriptHtml,'[testFriendlycaptchaOnLoginForm]: Friendlycaptcha NoScript is not shown on form.');
$this->assertSession()->responseNotContains($friendlyCaptchaHtml,'[testFriendlycaptchaOnLoginForm]: Friendlycaptcha is not shown on form.');
$this->assertSession()->responseNotContains($friendlyCaptchaNoScriptHtml,'[testFriendlycaptchaOnLoginForm]: Friendlycaptcha NoScript is not shown on form.');
$this->assertNotNull($result,'A configuration has been found for CAPTCHA point: user_login_form','Friendlycaptcha');
$this->assertNotNull($result,'A configuration has been found for CAPTCHA point: user_login_form');
$this->assertEquals($result->getCaptchaType(),'friendlycaptcha/friendlycaptcha','Friendlycaptcha type has been configured for CAPTCHA point: user_login_form');
// Check if a Math CAPTCHA is still shown on the login form. The site key
// and security key have not yet configured for Friendlycaptcha.
// The module needs to fall back to math captcha.
$this->drupalGet('user/login');
$this->assertSession()->responseContains($this->t('Math question'),'[testFriendlycaptchaOnLoginForm]: Math CAPTCHA is shown on form.');
$this->assertSession()->pageTextContains($this->t('The answer you entered for the CAPTCHA was not correct.'),'CAPTCHA should block user login form','Friendlycaptcha');
$this->assertSession()->pageTextContains($this->t('The answer you entered for the CAPTCHA was not correct.'));
// And make sure that user is not logged in: check for name and password