diff --git a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php index feefe0aeb8f0abfeb29e7cf7f741f40d67899916..14b7a07c708210d7f1aaa6374fab4fc2a7718b5b 100644 --- a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php +++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php @@ -138,8 +138,8 @@ protected function setupBaseFields(array $base_fields) { // Add a description field to the fields supplied by the EntityTest // classes. This example comes from the taxonomy Term entity. $base_fields['description'] = BaseFieldDefinition::create('text_long') - ->setLabel(t('Description')) - ->setDescription(t('A description of the term.')) + ->setLabel('Description') + ->setDescription('A description of the term.') ->setTranslatable(TRUE) ->setDisplayOptions('view', array( 'label' => 'hidden', @@ -155,8 +155,8 @@ protected function setupBaseFields(array $base_fields) { // Add a URL field; this example is from the Comment entity. $base_fields['homepage'] = BaseFieldDefinition::create('uri') - ->setLabel(t('Homepage')) - ->setDescription(t("The comment author's home page address.")) + ->setLabel('Homepage') + ->setDescription("The comment author's home page address.") ->setTranslatable(TRUE) ->setSetting('max_length', 255); @@ -409,8 +409,8 @@ public function testBaseTableFields() { $base_field_definitions = $this->setupBaseFields(EntityTest::baseFieldDefinitions($this->baseEntityType)); $user_base_field_definitions = [ 'uid' => BaseFieldDefinition::create('integer') - ->setLabel(t('ID')) - ->setDescription(t('The ID of the user entity.')) + ->setLabel('ID') + ->setDescription('The ID of the user entity.') ->setReadOnly(TRUE) ->setSetting('unsigned', TRUE) ]; @@ -498,8 +498,8 @@ public function testDataTableFields() { $base_field_definitions = $this->setupBaseFields($base_field_definitions); $user_base_field_definitions = [ 'uid' => BaseFieldDefinition::create('integer') - ->setLabel(t('ID')) - ->setDescription(t('The ID of the user entity.')) + ->setLabel('ID') + ->setDescription('The ID of the user entity.') ->setReadOnly(TRUE) ->setSetting('unsigned', TRUE) ]; @@ -621,8 +621,8 @@ public function testRevisionTableFields() { $base_field_definitions = $this->setupBaseFields(EntityTestMulRev::baseFieldDefinitions($this->baseEntityType)); $user_base_field_definitions = [ 'uid' => BaseFieldDefinition::create('integer') - ->setLabel(t('ID')) - ->setDescription(t('The ID of the user entity.')) + ->setLabel('ID') + ->setDescription('The ID of the user entity.') ->setReadOnly(TRUE) ->setSetting('unsigned', TRUE) ]; @@ -970,10 +970,11 @@ public function setKey($key, $value) { } -namespace { +namespace Drupal\entity_test\Entity { if (!function_exists('t')) { function t($string, array $args = []) { return strtr($string, $args); } } } + diff --git a/core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php b/core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php index f8948c706fcebf2c2c1c4f020413be1fa81940be..51b9f9fdc6ee1d233f2f166d1e1652d1399839ac 100644 --- a/core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php +++ b/core/tests/Drupal/Tests/Core/Render/Element/MachineNameTest.php @@ -110,7 +110,7 @@ public function testProcessMachineName() { } -namespace { +namespace Drupal\Core\Render\Element { if (!function_exists('t')) { function t($string, array $args = []) { return strtr($string, $args);