diff --git a/tests/src/Functional/CaptchaPersistenceTest.php b/tests/src/Functional/CaptchaPersistenceTest.php index 7529ff7..e8e5274 100755 --- a/tests/src/Functional/CaptchaPersistenceTest.php +++ b/tests/src/Functional/CaptchaPersistenceTest.php @@ -78,7 +78,7 @@ class CaptchaPersistenceTest extends CaptchaWebTestBase { 'pass' => 'bazlaz', 'captcha_response' => 'Test 123', ]; - $this->drupalPostForm(NULL, $edit, t('Log in'), [], self::LOGIN_HTML_FORM_ID); + $this->drupalPostForm(NULL, $edit, $this->t('Log in'), [], self::LOGIN_HTML_FORM_ID); // Check that there was no error message for the CAPTCHA. $this->assertCaptchaResponseAccepted(); @@ -88,7 +88,7 @@ class CaptchaPersistenceTest extends CaptchaWebTestBase { $this->assertPreservedCsid($captcha_sid_initial); // Post from again. - $this->drupalPostForm(NULL, $edit, t('Log in'), [], self::LOGIN_HTML_FORM_ID); + $this->drupalPostForm(NULL, $edit, $this->t('Log in'), [], self::LOGIN_HTML_FORM_ID); // Check that there was no error message for the CAPTCHA. $this->assertCaptchaResponseAccepted(); $this->assertPreservedCsid($captcha_sid_initial); @@ -112,7 +112,7 @@ class CaptchaPersistenceTest extends CaptchaWebTestBase { 'pass' => 'bazlaz', 'captcha_response' => 'Test 123', ]; - $this->drupalPostForm(NULL, $edit, t('Log in'), [], self::LOGIN_HTML_FORM_ID); + $this->drupalPostForm(NULL, $edit, $this->t('Log in'), [], self::LOGIN_HTML_FORM_ID); // Check that there was no error message for the CAPTCHA. $this->assertCaptchaResponseAccepted(); // There shouldn't be a CAPTCHA on the new form. @@ -149,7 +149,7 @@ class CaptchaPersistenceTest extends CaptchaWebTestBase { 'pass' => 'bazlaz', 'captcha_response' => 'Test 123', ]; - $this->drupalPostForm(NULL, $edit, t('Log in'), [], self::LOGIN_HTML_FORM_ID); + $this->drupalPostForm(NULL, $edit, $this->t('Log in'), [], self::LOGIN_HTML_FORM_ID); // Check that there was no error message for the CAPTCHA. $this->assertCaptchaResponseAccepted(); // There shouldn't be a CAPTCHA on the new form. @@ -191,7 +191,7 @@ class CaptchaPersistenceTest extends CaptchaWebTestBase { 'pass' => 'bazlaz', 'captcha_response' => 'Test 123', ]; - $this->drupalPostForm(NULL, $edit, t('Log in'), [], self::LOGIN_HTML_FORM_ID); + $this->drupalPostForm(NULL, $edit, $this->t('Log in'), [], self::LOGIN_HTML_FORM_ID); // Check that there was no error message for the CAPTCHA. $this->assertCaptchaResponseAccepted(); // There shouldn't be a CAPTCHA on the new form. diff --git a/tests/src/Functional/CaptchaWebTestBase.php b/tests/src/Functional/CaptchaWebTestBase.php index ba69163..9727016 100755 --- a/tests/src/Functional/CaptchaWebTestBase.php +++ b/tests/src/Functional/CaptchaWebTestBase.php @@ -7,6 +7,7 @@ use Drupal\comment\Tests\CommentTestTrait; use Drupal\Core\Session\AccountInterface; use Drupal\field\Entity\FieldConfig; use Drupal\Tests\BrowserTestBase; +use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Base class for CAPTCHA tests. @@ -16,6 +17,7 @@ use Drupal\Tests\BrowserTestBase; abstract class CaptchaWebTestBase extends BrowserTestBase { use CommentTestTrait; + use StringTranslationTrait; /** * Wrong response error message.