Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ankithashetty created an issue. See original summary.

ankithashetty’s picture

Status: Active » Needs review
FileSize
6.81 KB

Replaced t() calls with $this->t() in the following patch, please review.

Thank you.

JeroenT’s picture

Status: Needs review » Needs work
+++ b/modules/rh_node/src/Tests/BehaviorSettingsFormAlterationsTest.php
@@ -83,7 +87,7 @@ class BehaviorSettingsFormAlterationsTest extends WebTestBase {
     $this->drupalPostForm(NULL, [
       'rh_override' => $override,
       'rh_action' => $action,
-    ], t('Save content type'));
+    ], $this->t('Save content type'));
 
     $saved_config = $this->behaviorSettingsManager->loadBehaviorSettingsAsConfig(
       'node_type', $test_content_type_id, TRUE);
@@ -141,7 +145,7 @@ class BehaviorSettingsFormAlterationsTest extends WebTestBase {

@@ -141,7 +145,7 @@ class BehaviorSettingsFormAlterationsTest extends WebTestBase {
     $this->drupalPostForm(NULL, [
       'rh_override' => $override,
       'rh_action' => $action,
-    ], t('Save content type'));
+    ], $this->t('Save content type'));
 
     $saved_config = $this->behaviorSettingsManager->loadBehaviorSettingsAsConfig(
       'node_type', $test_content_type_id, TRUE);
@@ -165,7 +169,7 @@ class BehaviorSettingsFormAlterationsTest extends WebTestBase {

@@ -165,7 +169,7 @@ class BehaviorSettingsFormAlterationsTest extends WebTestBase {
     $this->loadNodeFormForTestNode($node_id);
     $this->drupalPostForm(NULL, [
       'rh_action' => $action,
-    ], t('Save'));
+    ], $this->t('Save'));
 

t() calls are unnecessary in test cases.

See #3133726: [meta] Remove usage of t() in tests not testing translation

nikitagupta’s picture

Assigned: Unassigned » nikitagupta
nikitagupta’s picture

FileSize
5.16 KB
664 bytes

@JeroenT made changes suggested by you. please review.

nikitagupta’s picture

Assigned: nikitagupta » Unassigned
nikitagupta’s picture

Status: Needs work » Needs review
JeroenT’s picture

Status: Needs review » Needs work

$this is not available in procedural code. Changes in .module file should be reverted.

nikitagupta’s picture

Status: Needs work » Needs review
FileSize
4.46 KB
1.86 KB

@JeroenT made changes suggested by you. please review.

  • Matroskeen committed 5f67673 on 8.x-1.x authored by nikitagupta
    Issue #3131242 by nikitagupta, ankithashetty, JeroenT: t() calls should...
Matroskeen’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.