Commit af616f27 authored by Dinesh18's avatar Dinesh18 Committed by wundo

Issue #3057592 by Dinesh18, wundo: Use StringTranslationTrait on Tests/CaptchaPersistenceTestCase

parent a5f01506
......@@ -2,6 +2,8 @@
namespace Drupal\Tests\captcha\Functional;
use Drupal\Core\StringTranslation\StringTranslationTrait;
/**
* Tests CAPTCHA Persistence.
*
......@@ -9,6 +11,8 @@ namespace Drupal\Tests\captcha\Functional;
*/
class CaptchaPersistenceTest extends CaptchaWebTestBase {
use StringTranslationTrait;
/**
* Set up the persistence and CAPTCHA settings.
*
......@@ -78,7 +82,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 +92,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 +116,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 +153,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 +195,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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment