From bb09637449d911e06e378aa5f6bf207850d90c13 Mon Sep 17 00:00:00 2001 From: Eli Zoller Date: Tue, 24 Nov 2020 09:40:11 -0700 Subject: [PATCH] properly use StringTranslationTrait --- .../Plugin/Action/GenerateAudioDerivative.php | 6 ++-- .../GenerateAudioDerivativeTest.php | 6 ++-- .../Plugin/Action/GenerateImageDerivative.php | 6 ++-- .../Action/GenerateImageDerivativeFile.php | 4 +-- .../GenerateImageDerivativeTest.php | 6 ++-- .../Plugin/Action/GenerateOCRDerivative.php | 4 +-- .../Action/GenerateOCRDerivativeFile.php | 6 ++-- .../Plugin/Action/GenerateVideoDerivative.php | 6 ++-- .../GenerateVideoDerivativeTest.php | 6 ++-- src/EventGenerator/EmitEvent.php | 28 ++++++++------- .../Action/AbstractGenerateDerivative.php | 34 +++++++++---------- .../AbstractGenerateDerivativeMediaFile.php | 20 +++++------ src/Plugin/Condition/MediaHasMimetype.php | 4 +-- src/Plugin/Condition/NodeHadNamespace.php | 4 +-- src/Plugin/Condition/NodeHasParent.php | 8 ++--- .../src/Functional/ContentEntityTypeTest.php | 4 +-- .../src/Functional/DerivativeReactionTest.php | 6 ++-- tests/src/Functional/EmitNodeEventTest.php | 6 ++-- tests/src/Functional/EntityBundleTest.php | 2 +- .../FormDisplayAlterReactionTest.php | 3 +- .../Functional/GenerateDerivativeTestBase.php | 1 + tests/src/Functional/IndexingTest.php | 2 +- .../IslandoraFunctionalTestBase.php | 12 ++++--- .../IslandoraImageFormatterTest.php | 1 - .../Functional/IslandoraSettingsFormTest.php | 16 ++++----- .../JsonldSelfReferenceReactionTest.php | 2 +- .../JsonldTypeAlterReactionTest.php | 10 +++--- .../Functional/ViewModeAlterReactionTest.php | 2 +- 28 files changed, 109 insertions(+), 106 deletions(-) diff --git a/modules/islandora_audio/src/Plugin/Action/GenerateAudioDerivative.php b/modules/islandora_audio/src/Plugin/Action/GenerateAudioDerivative.php index 41e33d55..904d05e6 100644 --- a/modules/islandora_audio/src/Plugin/Action/GenerateAudioDerivative.php +++ b/modules/islandora_audio/src/Plugin/Action/GenerateAudioDerivative.php @@ -34,8 +34,8 @@ class GenerateAudioDerivative extends AbstractGenerateDerivative { */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form = parent::buildConfigurationForm($form, $form_state); - $form['mimetype']['#description'] = t('Mimetype to convert to (e.g. audio/mpeg, audio/m4a, etc...)'); - $form['args']['#description'] = t('Additional command line parameters for FFMpeg'); + $form['mimetype']['#description'] = $this->t('Mimetype to convert to (e.g. audio/mpeg, audio/m4a, etc...)'); + $form['args']['#description'] = $this->t('Additional command line parameters for FFMpeg'); return $form; } @@ -48,7 +48,7 @@ class GenerateAudioDerivative extends AbstractGenerateDerivative { if ($exploded_mime[0] != 'audio') { $form_state->setErrorByName( 'mimetype', - t('Please enter a audio mimetype (e.g. audio/mpeg, audio/m4a, etc...)') + $this->t('Please enter a audio mimetype (e.g. audio/mpeg, audio/m4a, etc...)') ); } } diff --git a/modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php b/modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php index 88fb38ce..fc1c6188 100644 --- a/modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php +++ b/modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php @@ -40,7 +40,7 @@ class GenerateAudioDerivativeTest extends GenerateDerivativeTestBase { // Create an action to generate a audio derivative. $this->drupalGet('admin/config/system/actions'); $this->getSession()->getPage()->findById("edit-action")->selectOption("Generate a audio derivative"); - $this->getSession()->getPage()->pressButton(t('Create')); + $this->getSession()->getPage()->pressButton($this->t('Create')); $this->assertSession()->statusCodeEquals(200); $this->getSession()->getPage()->fillField('edit-label', "Generate audio test derivative"); @@ -53,7 +53,7 @@ class GenerateAudioDerivativeTest extends GenerateDerivativeTestBase { $this->getSession()->getPage()->fillField('edit-args', "-f mp3"); $this->getSession()->getPage()->fillField('edit-scheme', "public"); $this->getSession()->getPage()->fillField('edit-path', "derp.mov"); - $this->getSession()->getPage()->pressButton(t('Save')); + $this->getSession()->getPage()->pressButton($this->t('Save')); $this->assertSession()->statusCodeEquals(200); // Create a context and add the action as a derivative reaction. @@ -68,7 +68,7 @@ class GenerateAudioDerivativeTest extends GenerateDerivativeTestBase { 'field_media_of[0][target_id]' => 'Test Node', 'field_tags[0][target_id]' => 'Preservation Master', ]; - $this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, t('Save')); + $this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, $this->t('Save')); $expected = [ 'source_uri' => 'test_file.txt', diff --git a/modules/islandora_image/src/Plugin/Action/GenerateImageDerivative.php b/modules/islandora_image/src/Plugin/Action/GenerateImageDerivative.php index fa713a71..e81f157b 100644 --- a/modules/islandora_image/src/Plugin/Action/GenerateImageDerivative.php +++ b/modules/islandora_image/src/Plugin/Action/GenerateImageDerivative.php @@ -32,8 +32,8 @@ class GenerateImageDerivative extends AbstractGenerateDerivative { */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form = parent::buildConfigurationForm($form, $form_state); - $form['mimetype']['#description'] = t('Mimetype to convert to (e.g. image/jpeg, image/png, etc...)'); - $form['args']['#description'] = t('Additional command line arguments for ImageMagick convert (e.g. -resize 50%'); + $form['mimetype']['#description'] = $this->t('Mimetype to convert to (e.g. image/jpeg, image/png, etc...)'); + $form['args']['#description'] = $this->t('Additional command line arguments for ImageMagick convert (e.g. -resize 50%'); return $form; } @@ -48,7 +48,7 @@ class GenerateImageDerivative extends AbstractGenerateDerivative { if ($exploded_mime[0] != "image") { $form_state->setErrorByName( 'mimetype', - t('Please enter an image mimetype (e.g. image/jpeg, image/png, etc...)') + $this->t('Please enter an image mimetype (e.g. image/jpeg, image/png, etc...)') ); } } diff --git a/modules/islandora_image/src/Plugin/Action/GenerateImageDerivativeFile.php b/modules/islandora_image/src/Plugin/Action/GenerateImageDerivativeFile.php index b73e163e..0228b602 100644 --- a/modules/islandora_image/src/Plugin/Action/GenerateImageDerivativeFile.php +++ b/modules/islandora_image/src/Plugin/Action/GenerateImageDerivativeFile.php @@ -25,7 +25,7 @@ class GenerateImageDerivativeFile extends AbstractGenerateDerivativeMediaFile { $config['mimetype'] = 'application/xml'; $config['queue'] = 'islandora-connector-houdini'; $config['destination_media_type'] = 'file'; - $config['scheme'] = file_default_scheme(); + $config['scheme'] = \Drupal::config('system.file')->get('default_scheme'); return $config; } @@ -34,7 +34,7 @@ class GenerateImageDerivativeFile extends AbstractGenerateDerivativeMediaFile { */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form = parent::buildConfigurationForm($form, $form_state); - $form['mimetype']['#description'] = t('Mimetype to convert to (e.g. application/xml, etc...)'); + $form['mimetype']['#description'] = $this->t('Mimetype to convert to (e.g. application/xml, etc...)'); $form['mimetype']['#value'] = 'image/jpeg'; $form['mimetype']['#type'] = 'hidden'; return $form; diff --git a/modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php b/modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php index 8c554186..b6e016fc 100644 --- a/modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php +++ b/modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php @@ -42,7 +42,7 @@ class GenerateImageDerivativeTest extends GenerateDerivativeTestBase { // Create an action to generate a jpeg thumbnail. $this->drupalGet('admin/config/system/actions'); $this->getSession()->getPage()->findById("edit-action")->selectOption("Generate an image derivative"); - $this->getSession()->getPage()->pressButton(t('Create')); + $this->getSession()->getPage()->pressButton($this->t('Create')); $this->assertSession()->statusCodeEquals(200); $this->getSession()->getPage()->fillField('edit-label', "Generate image test derivative"); @@ -55,7 +55,7 @@ class GenerateImageDerivativeTest extends GenerateDerivativeTestBase { $this->getSession()->getPage()->fillField('edit-args', "-thumbnail 20x20"); $this->getSession()->getPage()->fillField('edit-scheme', "public"); $this->getSession()->getPage()->fillField('edit-path', "derp.jpeg"); - $this->getSession()->getPage()->pressButton(t('Save')); + $this->getSession()->getPage()->pressButton($this->t('Save')); $this->assertSession()->statusCodeEquals(200); // Create a context and add the action as a derivative reaction. @@ -70,7 +70,7 @@ class GenerateImageDerivativeTest extends GenerateDerivativeTestBase { 'field_media_of[0][target_id]' => 'Test Node', 'field_tags[0][target_id]' => 'Preservation Master', ]; - $this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, t('Save')); + $this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, $this->t('Save')); $expected = [ 'source_uri' => 'test_file.txt', diff --git a/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivative.php b/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivative.php index 752d261b..745c5772 100644 --- a/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivative.php +++ b/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivative.php @@ -33,7 +33,7 @@ class GenerateOCRDerivative extends AbstractGenerateDerivative { */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form = parent::buildConfigurationForm($form, $form_state); - $form['mimetype']['#description'] = t('Mimetype to convert to (e.g. application/xml, etc...)'); + $form['mimetype']['#description'] = $this->t('Mimetype to convert to (e.g. application/xml, etc...)'); $form['mimetype']['#value'] = 'text/plain'; $form['mimetype']['#type'] = 'textfield'; @@ -50,7 +50,7 @@ class GenerateOCRDerivative extends AbstractGenerateDerivative { if ($exploded_mime[0] != 'text') { $form_state->setErrorByName( 'mimetype', - t('Please enter file mimetype (e.g. text/plain.)') + $this->t('Please enter file mimetype (e.g. text/plain.)') ); } } diff --git a/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivativeFile.php b/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivativeFile.php index 2c5cbcce..3e13aca9 100644 --- a/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivativeFile.php +++ b/modules/islandora_text_extraction/src/Plugin/Action/GenerateOCRDerivativeFile.php @@ -27,7 +27,7 @@ class GenerateOCRDerivativeFile extends AbstractGenerateDerivativeMediaFile { $config['mimetype'] = 'application/xml'; $config['queue'] = 'islandora-connector-ocr'; $config['destination_media_type'] = 'file'; - $config['scheme'] = file_default_scheme(); + $config['scheme'] = \Drupal::config('system.file')->get('default_scheme'); $config['destination_text_field_name'] = ''; return $config; } @@ -40,7 +40,7 @@ class GenerateOCRDerivativeFile extends AbstractGenerateDerivativeMediaFile { $file_fields = $map['media']; $field_options = array_combine(array_keys($file_fields), array_keys($file_fields)); $form = parent::buildConfigurationForm($form, $form_state); - $form['mimetype']['#description'] = t('Mimetype to convert to (e.g. application/xml, etc...)'); + $form['mimetype']['#description'] = $this->t('Mimetype to convert to (e.g. application/xml, etc...)'); $form['mimetype']['#value'] = 'text/plain'; $form['mimetype']['#type'] = 'hidden'; $position = array_search('destination_field_name', array_keys($form)); @@ -70,7 +70,7 @@ class GenerateOCRDerivativeFile extends AbstractGenerateDerivativeMediaFile { if ($exploded_mime[0] != 'text') { $form_state->setErrorByName( 'mimetype', - t('Please enter file mimetype (e.g. application/xml.)') + $this->t('Please enter file mimetype (e.g. application/xml.)') ); } } diff --git a/modules/islandora_video/src/Plugin/Action/GenerateVideoDerivative.php b/modules/islandora_video/src/Plugin/Action/GenerateVideoDerivative.php index c28ffdc0..7c861992 100644 --- a/modules/islandora_video/src/Plugin/Action/GenerateVideoDerivative.php +++ b/modules/islandora_video/src/Plugin/Action/GenerateVideoDerivative.php @@ -33,8 +33,8 @@ class GenerateVideoDerivative extends AbstractGenerateDerivative { */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form = parent::buildConfigurationForm($form, $form_state); - $form['mimetype']['#description'] = t('Mimetype to convert to (e.g. video/mp4, video/quicktime, etc...)'); - $form['args']['#description'] = t('Additional command line parameters for FFMpeg'); + $form['mimetype']['#description'] = $this->t('Mimetype to convert to (e.g. video/mp4, video/quicktime, etc...)'); + $form['args']['#description'] = $this->t('Additional command line parameters for FFMpeg'); return $form; } @@ -47,7 +47,7 @@ class GenerateVideoDerivative extends AbstractGenerateDerivative { if ($exploded_mime[0] != 'video') { $form_state->setErrorByName( 'mimetype', - t('Please enter a video mimetype (e.g. video/mp4, video/quicktime, etc...)') + $this->t('Please enter a video mimetype (e.g. video/mp4, video/quicktime, etc...)') ); } } diff --git a/modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php b/modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php index b7b5adc3..8714a2f1 100644 --- a/modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php +++ b/modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php @@ -37,7 +37,7 @@ class GenerateVideoDerivativeTest extends GenerateDerivativeTestBase { // Create an action to generate a jpeg thumbnail. $this->drupalGet('admin/config/system/actions'); $this->getSession()->getPage()->findById("edit-action")->selectOption("Generate a video derivative"); - $this->getSession()->getPage()->pressButton(t('Create')); + $this->getSession()->getPage()->pressButton($this->t('Create')); $this->assertSession()->statusCodeEquals(200); $this->getSession()->getPage()->fillField('edit-label', "Generate video test derivative"); @@ -50,7 +50,7 @@ class GenerateVideoDerivativeTest extends GenerateDerivativeTestBase { $this->getSession()->getPage()->fillField('edit-args', "-f mp4"); $this->getSession()->getPage()->fillField('edit-scheme', "public"); $this->getSession()->getPage()->fillField('edit-path', "derp.mov"); - $this->getSession()->getPage()->pressButton(t('Save')); + $this->getSession()->getPage()->pressButton($this->t('Save')); $this->assertSession()->statusCodeEquals(200); // Create a context and add the action as a derivative reaction. @@ -65,7 +65,7 @@ class GenerateVideoDerivativeTest extends GenerateDerivativeTestBase { 'field_media_of[0][target_id]' => 'Test Node', 'field_tags[0][target_id]' => 'Preservation Master', ]; - $this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, t('Save')); + $this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, $this->t('Save')); $expected = [ 'source_uri' => 'test_file.txt', diff --git a/src/EventGenerator/EmitEvent.php b/src/EventGenerator/EmitEvent.php index 2ebeed0c..ac03fbf0 100644 --- a/src/EventGenerator/EmitEvent.php +++ b/src/EventGenerator/EmitEvent.php @@ -10,6 +10,7 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\jwt\Authentication\Provider\JwtAuth; use Stomp\Exception\StompException; use Stomp\StatefulStomp; @@ -20,6 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * Configurable action base for actions that publish messages to queues. */ abstract class EmitEvent extends ConfigurableActionBase implements ContainerFactoryPluginInterface { + use StringTranslationTrait; /** * Current user. @@ -132,10 +134,10 @@ abstract class EmitEvent extends ConfigurableActionBase implements ContainerFact if (empty($token)) { // JWT isn't properly configured. Log and notify user. \Drupal::logger('islandora')->error( - t('Error getting JWT token for message. Check JWT Configuration.') + $this->t('Error getting JWT token for message. Check JWT Configuration.') ); $this->messenger->addMessage( - t('Error getting JWT token for message. Check JWT Configuration.'), 'error' + $this->t('Error getting JWT token for message. Check JWT Configuration.'), 'error' ); return; } @@ -152,10 +154,10 @@ abstract class EmitEvent extends ConfigurableActionBase implements ContainerFact catch (\RuntimeException $e) { // Notify the user the event couldn't be generated and abort. \Drupal::logger('islandora')->error( - t('Error generating event: @msg', ['@msg' => $e->getMessage()]) + $this->t('Error generating event: @msg', ['@msg' => $e->getMessage()]) ); $this->messenger->addMessage( - t('Error generating event: @msg', ['@msg' => $e->getMessage()]), + $this->t('Error generating event: @msg', ['@msg' => $e->getMessage()]), 'error' ); return; @@ -176,7 +178,7 @@ abstract class EmitEvent extends ConfigurableActionBase implements ContainerFact // Notify user. $this->messenger->addMessage( - t('Error publishing message: @msg', + $this->t('Error publishing message: @msg', ['@msg' => $e->getMessage()] ), 'error' @@ -207,22 +209,22 @@ abstract class EmitEvent extends ConfigurableActionBase implements ContainerFact public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['queue'] = [ '#type' => 'textfield', - '#title' => t('Queue'), + '#title' => $this->t('Queue'), '#default_value' => $this->configuration['queue'], '#required' => TRUE, '#rows' => '8', - '#description' => t('Name of queue to which event is published'), + '#description' => $this->t('Name of queue to which event is published'), ]; $form['event'] = [ '#type' => 'select', - '#title' => t('Event type'), + '#title' => $this->t('Event type'), '#default_value' => $this->configuration['event'], - '#description' => t('Type of event to emit'), + '#description' => $this->t('Type of event to emit'), '#options' => [ - 'Create' => t('Create'), - 'Update' => t('Update'), - 'Delete' => t('Delete'), - 'Generate Derivative' => t('Generate Derivative'), + 'Create' => $this->t('Create'), + 'Update' => $this->t('Update'), + 'Delete' => $this->t('Delete'), + 'Generate Derivative' => $this->t('Generate Derivative'), ], ]; return $form; diff --git a/src/Plugin/Action/AbstractGenerateDerivative.php b/src/Plugin/Action/AbstractGenerateDerivative.php index 7c9b2bfa..fb83c082 100644 --- a/src/Plugin/Action/AbstractGenerateDerivative.php +++ b/src/Plugin/Action/AbstractGenerateDerivative.php @@ -219,60 +219,60 @@ class AbstractGenerateDerivative extends EmitEvent { $form['source_term'] = [ '#type' => 'entity_autocomplete', '#target_type' => 'taxonomy_term', - '#title' => t('Source term'), + '#title' => $this->t('Source term'), '#default_value' => $this->utils->getTermForUri($this->configuration['source_term_uri']), '#required' => TRUE, - '#description' => t('Term indicating the source media'), + '#description' => $this->t('Term indicating the source media'), ]; $form['derivative_term'] = [ '#type' => 'entity_autocomplete', '#target_type' => 'taxonomy_term', - '#title' => t('Derivative term'), + '#title' => $this->t('Derivative term'), '#default_value' => $this->utils->getTermForUri($this->configuration['derivative_term_uri']), '#required' => TRUE, - '#description' => t('Term indicating the derivative media'), + '#description' => $this->t('Term indicating the derivative media'), ]; $form['destination_media_type'] = [ '#type' => 'entity_autocomplete', '#target_type' => 'media_type', - '#title' => t('Derivative media type'), + '#title' => $this->t('Derivative media type'), '#default_value' => $this->getEntityById($this->configuration['destination_media_type']), '#required' => TRUE, - '#description' => t('The Drupal media type to create with this derivative, can be different than the source'), + '#description' => $this->t('The Drupal media type to create with this derivative, can be different than the source'), ]; $form['mimetype'] = [ '#type' => 'textfield', - '#title' => t('Mimetype'), + '#title' => $this->t('Mimetype'), '#default_value' => $this->configuration['mimetype'], '#required' => TRUE, '#rows' => '8', - '#description' => t('Mimetype to convert to (e.g. image/jpeg, video/mp4, etc...)'), + '#description' => $this->t('Mimetype to convert to (e.g. image/jpeg, video/mp4, etc...)'), ]; $form['args'] = [ '#type' => 'textfield', - '#title' => t('Additional arguments'), + '#title' => $this->t('Additional arguments'), '#default_value' => $this->configuration['args'], '#rows' => '8', - '#description' => t('Additional command line arguments'), + '#description' => $this->t('Additional command line arguments'), ]; $form['scheme'] = [ '#type' => 'select', - '#title' => t('File system'), + '#title' => $this->t('File system'), '#options' => $scheme_options, '#default_value' => $this->configuration['scheme'], '#required' => TRUE, ]; $form['path'] = [ '#type' => 'textfield', - '#title' => t('File path'), + '#title' => $this->t('File path'), '#default_value' => $this->configuration['path'], - '#description' => t('Path within the upload destination where files will be stored. Includes the filename and optional extension.'), + '#description' => $this->t('Path within the upload destination where files will be stored. Includes the filename and optional extension.'), ]; $form['queue'] = [ '#type' => 'textfield', - '#title' => t('Queue name'), + '#title' => $this->t('Queue name'), '#default_value' => $this->configuration['queue'], - '#description' => t('Queue name to send along to help routing events, CHANGE WITH CARE. Defaults to :queue', [ + '#description' => $this->t('Queue name to send along to help routing events, CHANGE WITH CARE. Defaults to :queue', [ ':queue' => $this->defaultConfiguration()['queue'], ]), ]; @@ -290,14 +290,14 @@ class AbstractGenerateDerivative extends EmitEvent { if (count($exploded_mime) != 2) { $form_state->setErrorByName( 'mimetype', - t('Please enter a mimetype (e.g. image/jpeg, video/mp4, audio/mp3, etc...)') + $this->t('Please enter a mimetype (e.g. image/jpeg, video/mp4, audio/mp3, etc...)') ); } if (empty($exploded_mime[1])) { $form_state->setErrorByName( 'mimetype', - t('Please enter a mimetype (e.g. image/jpeg, video/mp4, audio/mp3, etc...)') + $this->t('Please enter a mimetype (e.g. image/jpeg, video/mp4, audio/mp3, etc...)') ); } } diff --git a/src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php b/src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php index 7cf2f963..d964c562 100644 --- a/src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php +++ b/src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php @@ -236,32 +236,32 @@ class AbstractGenerateDerivativeMediaFile extends EmitEvent { $form['args'] = [ '#type' => 'textfield', - '#title' => t('Additional arguments'), + '#title' => $this->t('Additional arguments'), '#default_value' => $this->configuration['args'], '#rows' => '8', - '#description' => t('Additional command line arguments'), + '#description' => $this->t('Additional command line arguments'), ]; $form['mimetype'] = [ '#type' => 'textfield', - '#title' => t('Mimetype'), + '#title' => $this->t('Mimetype'), '#default_value' => $this->configuration['mimetype'], '#required' => TRUE, '#rows' => '8', - '#description' => t('Mimetype to convert to (e.g. image/jpeg, video/mp4, etc...)'), + '#description' => $this->t('Mimetype to convert to (e.g. image/jpeg, video/mp4, etc...)'), ]; $form['path'] = [ '#type' => 'textfield', - '#title' => t('File path'), + '#title' => $this->t('File path'), '#default_value' => $this->configuration['path'], - '#description' => t('Path within the upload destination where files will be stored. Includes the filename and optional extension.'), + '#description' => $this->t('Path within the upload destination where files will be stored. Includes the filename and optional extension.'), ]; $form['queue'] = [ '#type' => 'textfield', - '#title' => t('Queue name'), + '#title' => $this->t('Queue name'), '#default_value' => $this->configuration['queue'], - '#description' => t('Queue name to send along to help routing events, CHANGE WITH CARE. Defaults to :queue', [ + '#description' => $this->t('Queue name to send along to help routing events, CHANGE WITH CARE. Defaults to :queue', [ ':queue' => $this->defaultConfiguration()['queue'], ]), ]; @@ -278,14 +278,14 @@ class AbstractGenerateDerivativeMediaFile extends EmitEvent { if (count($exploded) != 2) { $form_state->setErrorByName( 'mimetype', - t('Please enter a mimetype (e.g. image/jpeg, video/mp4, audio/mp3, etc...)') + $this->t('Please enter a mimetype (e.g. image/jpeg, video/mp4, audio/mp3, etc...)') ); } if (empty($exploded[1])) { $form_state->setErrorByName( 'mimetype', - t('Please enter a mimetype (e.g. image/jpeg, video/mp4, audio/mp3, etc...)') + $this->t('Please enter a mimetype (e.g. image/jpeg, video/mp4, audio/mp3, etc...)') ); } } diff --git a/src/Plugin/Condition/MediaHasMimetype.php b/src/Plugin/Condition/MediaHasMimetype.php index 291c0da6..52dfe749 100644 --- a/src/Plugin/Condition/MediaHasMimetype.php +++ b/src/Plugin/Condition/MediaHasMimetype.php @@ -101,11 +101,11 @@ class MediaHasMimetype extends ConditionPluginBase implements ContainerFactoryPl public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['mimetypes'] = [ '#type' => 'textfield', - '#title' => t('Mime types'), + '#title' => $this->t('Mime types'), '#default_value' => $this->configuration['mimetypes'], '#required' => TRUE, '#maxlength' => 256, - '#description' => t('Comma-delimited list of Mime types (e.g. image/jpeg, video/mp4, etc...) that trigger the condition.'), + '#description' => $this->t('Comma-delimited list of Mime types (e.g. image/jpeg, video/mp4, etc...) that trigger the condition.'), ]; return parent::buildConfigurationForm($form, $form_state); } diff --git a/src/Plugin/Condition/NodeHadNamespace.php b/src/Plugin/Condition/NodeHadNamespace.php index 4872f7eb..0ec25afd 100644 --- a/src/Plugin/Condition/NodeHadNamespace.php +++ b/src/Plugin/Condition/NodeHadNamespace.php @@ -95,11 +95,11 @@ class NodeHadNamespace extends ConditionPluginBase implements ContainerFactoryPl $options = array_combine($node_fields, $node_fields); $form['pid_field'] = [ '#type' => 'select', - '#title' => t('Field that contains the PID'), + '#title' => $this->t('Field that contains the PID'), '#options' => $options, '#default_value' => $this->configuration['pid_field'], '#required' => TRUE, - '#description' => t("Machine name of the field that contains the PID."), + '#description' => $this->t("Machine name of the field that contains the PID."), ]; return parent::buildConfigurationForm($form, $form_state); diff --git a/src/Plugin/Condition/NodeHasParent.php b/src/Plugin/Condition/NodeHasParent.php index 5002707f..ac3821d8 100644 --- a/src/Plugin/Condition/NodeHasParent.php +++ b/src/Plugin/Condition/NodeHasParent.php @@ -82,10 +82,10 @@ class NodeHasParent extends ConditionPluginBase implements ContainerFactoryPlugi public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form['parent_nid'] = [ '#type' => 'entity_autocomplete', - '#title' => t('Parent node'), + '#title' => $this->t('Parent node'), '#default_value' => $this->entityTypeManager->getStorage('node')->load($this->configuration['parent_nid']), '#required' => TRUE, - '#description' => t("Can be a collection node or a compound object."), + '#description' => $this->t("Can be a collection node or a compound object."), '#target_type' => 'node', ]; $field_map = \Drupal::service('entity_field.manager')->getFieldMapByFieldType('entity_reference'); @@ -93,11 +93,11 @@ class NodeHasParent extends ConditionPluginBase implements ContainerFactoryPlugi $options = array_combine($node_fields, $node_fields); $form['parent_reference_field'] = [ '#type' => 'select', - '#title' => t('Field that contains reference to parents'), + '#title' => $this->('Field that contains reference to parents'), '#options' => $options, '#default_value' => $this->configuration['parent_reference_field'], '#required' => TRUE, - '#description' => t("Machine name of field that contains references to parent node."), + '#description' => $this->t("Machine name of field that contains references to parent node."), ]; return parent::buildConfigurationForm($form, $form_state); diff --git a/tests/src/Functional/ContentEntityTypeTest.php b/tests/src/Functional/ContentEntityTypeTest.php index caf11de3..852e33bf 100644 --- a/tests/src/Functional/ContentEntityTypeTest.php +++ b/tests/src/Functional/ContentEntityTypeTest.php @@ -39,7 +39,7 @@ class ContentEntityTypeTest extends IslandoraFunctionalTestBase { $this->addCondition('test', 'content_entity_type'); $this->getSession()->getPage()->checkField("edit-conditions-content-entity-type-types-node"); $this->getSession()->getPage()->findById("edit-conditions-content-entity-type-context-mapping-node")->selectOption("@node.node_route_context:node"); - $this->getSession()->getPage()->pressButton(t('Save and continue')); + $this->getSession()->getPage()->pressButton($this->t('Save and continue')); $this->addPresetReaction('test', 'index', 'hello_world'); // Create a new node confirm Hello World! is printed to the screen. @@ -53,7 +53,7 @@ class ContentEntityTypeTest extends IslandoraFunctionalTestBase { 'name[0][value]' => 'Test Media', 'files[field_media_file_0]' => __DIR__ . '/../../fixtures/test_file.txt', ]; - $this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, t('Save')); + $this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, $this->t('Save')); $this->assertSession()->pageTextNotContains("Hello World!"); } diff --git a/tests/src/Functional/DerivativeReactionTest.php b/tests/src/Functional/DerivativeReactionTest.php index 38ec6ffa..e1b1c827 100644 --- a/tests/src/Functional/DerivativeReactionTest.php +++ b/tests/src/Functional/DerivativeReactionTest.php @@ -52,7 +52,7 @@ class DerivativeReactionTest extends IslandoraFunctionalTestBase { 'files[field_media_file_0]' => __DIR__ . '/../../fixtures/test_file.txt', 'field_media_of[0][target_id]' => 'Test Node', ]; - $this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, t('Save')); + $this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, $this->t('Save')); // field_media_of is set and there's a file, so derivatives should fire. $this->assertSession()->pageTextContains("Hello World!"); @@ -70,9 +70,9 @@ class DerivativeReactionTest extends IslandoraFunctionalTestBase { 'files[field_media_file_0]' => __DIR__ . '/../../fixtures/test_file2.txt', ]; $this->drupalGet($media_url . '/edit'); - $this->getSession()->getPage()->pressButton(t('Remove')); + $this->getSession()->getPage()->pressButton($this->t('Remove')); $this->getSession()->getPage()->fillField('files[field_media_file_0]', __DIR__ . '/../../fixtures/test_file2.txt'); - $this->getSession()->getPage()->pressButton(t('Save')); + $this->getSession()->getPage()->pressButton($this->t('Save')); $this->assertSession()->pageTextContains("Hello World!"); } diff --git a/tests/src/Functional/EmitNodeEventTest.php b/tests/src/Functional/EmitNodeEventTest.php index d3bb7449..dd2703de 100644 --- a/tests/src/Functional/EmitNodeEventTest.php +++ b/tests/src/Functional/EmitNodeEventTest.php @@ -44,7 +44,7 @@ class EmitNodeEventTest extends IslandoraFunctionalTestBase { $this->addCondition('test', 'content_entity_type'); $this->getSession()->getPage()->checkField("edit-conditions-content-entity-type-types-node"); $this->getSession()->getPage()->findById("edit-conditions-content-entity-type-context-mapping-node")->selectOption("@node.node_route_context:node"); - $this->getSession()->getPage()->pressButton(t('Save and continue')); + $this->getSession()->getPage()->pressButton($this->t('Save and continue')); $this->addPresetReaction('test', 'index', $action_id); $this->assertSession()->statusCodeEquals(200); @@ -68,7 +68,7 @@ class EmitNodeEventTest extends IslandoraFunctionalTestBase { protected function createEmitAction($entity_type, $event_type) { $this->drupalGet('admin/config/system/actions'); $this->getSession()->getPage()->findById("edit-action")->selectOption("Emit a $entity_type event to a queue/topic"); - $this->getSession()->getPage()->pressButton(t('Create')); + $this->getSession()->getPage()->pressButton($this->t('Create')); $this->assertSession()->statusCodeEquals(200); $action_id = "emit_" . $entity_type . "_" . lcfirst($event_type); @@ -76,7 +76,7 @@ class EmitNodeEventTest extends IslandoraFunctionalTestBase { $this->getSession()->getPage()->fillField('edit-id', $action_id); $this->getSession()->getPage()->fillField('edit-queue', "emit-$entity_type-" . lcfirst($event_type)); $this->getSession()->getPage()->findById("edit-event")->selectOption($event_type); - $this->getSession()->getPage()->pressButton(t('Save')); + $this->getSession()->getPage()->pressButton($this->t('Save')); $this->assertSession()->statusCodeEquals(200); return $action_id; diff --git a/tests/src/Functional/EntityBundleTest.php b/tests/src/Functional/EntityBundleTest.php index 740ce8c1..bde1ee40 100644 --- a/tests/src/Functional/EntityBundleTest.php +++ b/tests/src/Functional/EntityBundleTest.php @@ -27,7 +27,7 @@ class EntityBundleTest extends IslandoraFunctionalTestBase { $this->addCondition('test', 'islandora_entity_bundle'); $this->getSession()->getPage()->checkField("edit-conditions-islandora-entity-bundle-bundles-test-type"); $this->getSession()->getPage()->findById("edit-conditions-islandora-entity-bundle-context-mapping-node")->selectOption("@node.node_route_context:node"); - $this->getSession()->getPage()->pressButton(t('Save and continue')); + $this->getSession()->getPage()->pressButton($this->t('Save and continue')); $this->addPresetReaction('test', 'index', 'hello_world'); // Create a new test_type confirm Hello World! is printed to the screen. diff --git a/tests/src/Functional/FormDisplayAlterReactionTest.php b/tests/src/Functional/FormDisplayAlterReactionTest.php index 08501579..7dadd638 100644 --- a/tests/src/Functional/FormDisplayAlterReactionTest.php +++ b/tests/src/Functional/FormDisplayAlterReactionTest.php @@ -8,7 +8,6 @@ namespace Drupal\Tests\islandora\Functional; * @group islandora */ class FormDisplayAlterReactionTest extends IslandoraFunctionalTestBase { - /** * @covers \Drupal\islandora\Plugin\ContextReaction\FormDisplayAlterReaction::execute * @covers \Drupal\islandora\Plugin\ContextReaction\FormDisplayAlterReaction::buildConfigurationForm @@ -49,7 +48,7 @@ class FormDisplayAlterReactionTest extends IslandoraFunctionalTestBase { $this->drupalGet("admin/structure/context/test/reaction/add/form_display_alter"); $this->getSession()->getPage()->findById("edit-reactions-form-display-alter-mode")->selectOption('node.secondary'); - $this->getSession()->getPage()->pressButton(t('Save and continue')); + $this->getSession()->getPage()->pressButton($this->t('Save and continue')); $this->assertSession()->statusCodeEquals(200); drupal_flush_all_caches(); diff --git a/tests/src/Functional/GenerateDerivativeTestBase.php b/tests/src/Functional/GenerateDerivativeTestBase.php index c74ff255..94c2d7d0 100644 --- a/tests/src/Functional/GenerateDerivativeTestBase.php +++ b/tests/src/Functional/GenerateDerivativeTestBase.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\islandora\Functional; + /** * Tests the GenerateDerivative action. */ diff --git a/tests/src/Functional/IndexingTest.php b/tests/src/Functional/IndexingTest.php index bd451fc3..e995329d 100644 --- a/tests/src/Functional/IndexingTest.php +++ b/tests/src/Functional/IndexingTest.php @@ -65,7 +65,7 @@ class IndexingTest extends IslandoraFunctionalTestBase { $this->addPresetReaction('test', 'delete', 'goodbye_world'); // Delete the node. - $this->drupalPostForm("$url/delete", [], t('Delete')); + $this->drupalPostForm("$url/delete", [], $this->t('Delete')); $this->assertSession()->statusCodeEquals(200); // Confirm Goodbye, Cruel World! is printed to the screen. diff --git a/tests/src/Functional/IslandoraFunctionalTestBase.php b/tests/src/Functional/IslandoraFunctionalTestBase.php index 0b942eb8..45326bc8 100644 --- a/tests/src/Functional/IslandoraFunctionalTestBase.php +++ b/tests/src/Functional/IslandoraFunctionalTestBase.php @@ -5,6 +5,7 @@ namespace Drupal\Tests\islandora\Functional; use Drupal\Core\Config\FileStorage; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\link\LinkItemInterface; use Drupal\Tests\BrowserTestBase; use Drupal\Tests\field\Traits\EntityReferenceTestTrait; @@ -19,6 +20,7 @@ class IslandoraFunctionalTestBase extends BrowserTestBase { use EntityReferenceTestTrait; use TestFileCreationTrait; use MediaTypeCreationTrait; + use StringTranslationTrait; /** * {@inheritdoc} @@ -275,7 +277,7 @@ EOD; 'label' => $label, 'name' => $name, ], - t('Save')); + $this->t('Save')); $this->assertSession()->statusCodeEquals(200); } @@ -297,7 +299,7 @@ EOD; ->getPage() ->findById("edit-reactions-$reaction_type-actions") ->selectOption($action_id); - $this->getSession()->getPage()->pressButton(t('Save and continue')); + $this->getSession()->getPage()->pressButton($this->t('Save and continue')); $this->assertSession()->statusCodeEquals(200); } @@ -305,7 +307,7 @@ EOD; * Create a new node by posting its add form. */ protected function postNodeAddForm($bundle_id, $values, $button_text) { - $this->drupalPostForm("node/add/$bundle_id", $values, t('@text', ['@text' => $button_text])); + $this->drupalPostForm("node/add/$bundle_id", $values, $this->t('@text', ['@text' => $button_text])); $this->assertSession()->statusCodeEquals(200); } @@ -313,7 +315,7 @@ EOD; * Create a new node by posting its add form. */ protected function postTermAddForm($taxomony_id, $values, $button_text) { - $this->drupalPostForm("admin/structure/taxonomy/manage/$taxomony_id/add", $values, t('@text', ['@text' => $button_text])); + $this->drupalPostForm("admin/structure/taxonomy/manage/$taxomony_id/add", $values, $this->t('@text', ['@text' => $button_text])); $this->assertSession()->statusCodeEquals(200); } @@ -321,7 +323,7 @@ EOD; * Edits a node by posting its edit form. */ protected function postEntityEditForm($entity_url, $values, $button_text) { - $this->drupalPostForm("$entity_url/edit", $values, t('@text', ['@text' => $button_text])); + $this->drupalPostForm("$entity_url/edit", $values, $this->t('@text', ['@text' => $button_text])); $this->assertSession()->statusCodeEquals(200); } diff --git a/tests/src/Functional/IslandoraImageFormatterTest.php b/tests/src/Functional/IslandoraImageFormatterTest.php index 9572b1e7..2793cf49 100644 --- a/tests/src/Functional/IslandoraImageFormatterTest.php +++ b/tests/src/Functional/IslandoraImageFormatterTest.php @@ -78,7 +78,6 @@ class IslandoraImageFormatterTest extends IslandoraFunctionalTestBase { // Assert that the image is rendered into html as a link pointing // to the Node, not the Media (that's what the islandora_image // formatter does). - $elements = $this->xpath( '//a[@href=:path]/img[@src=:url and @alt=:alt and @title=:title]', [ diff --git a/tests/src/Functional/IslandoraSettingsFormTest.php b/tests/src/Functional/IslandoraSettingsFormTest.php index bdf15d29..5373a3dd 100644 --- a/tests/src/Functional/IslandoraSettingsFormTest.php +++ b/tests/src/Functional/IslandoraSettingsFormTest.php @@ -37,10 +37,10 @@ class IslandoraSettingsFormTest extends IslandoraFunctionalTestBase { $this->assertSession()->pageTextContains("Gemini URL"); $this->assertSession()->fieldValueEquals('edit-gemini-url', ''); - $this->drupalPostForm('admin/config/islandora/core', ['edit-gemini-url' => 'not_a_url'], t('Save configuration')); + $this->drupalPostForm('admin/config/islandora/core', ['edit-gemini-url' => 'not_a_url'], $this->t('Save configuration')); $this->assertSession()->pageTextContainsOnce("Cannot parse URL not_a_url"); - $this->drupalPostForm('admin/config/islandora/core', ['edit-gemini-url' => 'http://whaturl.bob'], t('Save configuration')); + $this->drupalPostForm('admin/config/islandora/core', ['edit-gemini-url' => 'http://whaturl.bob'], $this->t('Save configuration')); $this->assertSession()->pageTextContainsOnce("Cannot connect to URL http://whaturl.bob"); } @@ -53,7 +53,7 @@ class IslandoraSettingsFormTest extends IslandoraFunctionalTestBase { $this->drupalPostForm('admin/config/islandora/core', [ 'gemini_pseudo_bundles[test_type:node]' => TRUE, - ], t('Save configuration')); + ], $this->t('Save configuration')); $this->assertSession()->pageTextContainsOnce("Must enter Gemini URL before selecting bundles to display a pseudo field on."); } @@ -67,19 +67,19 @@ class IslandoraSettingsFormTest extends IslandoraFunctionalTestBase { $this->assertSession()->pageTextContains("JWT Expiry"); $this->assertSession()->fieldValueEquals('edit-jwt-expiry', '+2 hour'); // Blank is not allowed. - $this->drupalPostForm('/admin/config/islandora/core', ['edit-jwt-expiry' => ""], t('Save configuration')); + $this->drupalPostForm('/admin/config/islandora/core', ['edit-jwt-expiry' => ""], $this->t('Save configuration')); $this->assertSession()->pageTextContainsOnce('"" is not a valid time or interval expression.'); // Negative is not allowed. - $this->drupalPostForm('/admin/config/islandora/core', ['edit-jwt-expiry' => "-2 hours"], t('Save configuration')); + $this->drupalPostForm('/admin/config/islandora/core', ['edit-jwt-expiry' => "-2 hours"], $this->t('Save configuration')); $this->assertSession()->pageTextContainsOnce('Time or interval expression cannot be negative'); // Must include an integer value. - $this->drupalPostForm('/admin/config/islandora/core', ['edit-jwt-expiry' => "last hour"], t('Save configuration')); + $this->drupalPostForm('/admin/config/islandora/core', ['edit-jwt-expiry' => "last hour"], $this->t('Save configuration')); $this->assertSession()->pageTextContainsOnce('No numeric interval specified, for example "1 day"'); // Must have an accepted interval. - $this->drupalPostForm('/admin/config/islandora/core', ['edit-jwt-expiry' => "1 fortnight"], t('Save configuration')); + $this->drupalPostForm('/admin/config/islandora/core', ['edit-jwt-expiry' => "1 fortnight"], $this->t('Save configuration')); $this->assertSession()->pageTextContainsOnce('No time interval found, please include one of'); // Test a valid setting. - $this->drupalPostForm('/admin/config/islandora/core', ['edit-jwt-expiry' => "2 weeks"], t('Save configuration')); + $this->drupalPostForm('/admin/config/islandora/core', ['edit-jwt-expiry' => "2 weeks"], $this->t('Save configuration')); $this->assertSession()->pageTextContainsOnce('The configuration options have been saved.'); } diff --git a/tests/src/Functional/JsonldSelfReferenceReactionTest.php b/tests/src/Functional/JsonldSelfReferenceReactionTest.php index 52242118..f3f62ffd 100644 --- a/tests/src/Functional/JsonldSelfReferenceReactionTest.php +++ b/tests/src/Functional/JsonldSelfReferenceReactionTest.php @@ -51,7 +51,7 @@ class JsonldSelfReferenceReactionTest extends IslandoraFunctionalTestBase { $this->postNodeAddForm('test_type', ['title[0][value]' => 'Test Node'], - t('Save')); + $this->t('Save')); $this->assertSession()->pageTextContains("Test Node"); $url = $this->getUrl(); diff --git a/tests/src/Functional/JsonldTypeAlterReactionTest.php b/tests/src/Functional/JsonldTypeAlterReactionTest.php index 6e838126..e5d21abc 100644 --- a/tests/src/Functional/JsonldTypeAlterReactionTest.php +++ b/tests/src/Functional/JsonldTypeAlterReactionTest.php @@ -27,16 +27,16 @@ class JsonldTypeAlterReactionTest extends JsonldSelfReferenceReactionTest { 'new_storage_type' => 'string', 'label' => 'Typed Predicate', 'field_name' => 'type_predicate', - ], t('Save and continue')); - $this->drupalPostForm(NULL, [], t('Save field settings')); - $this->drupalPostForm(NULL, [], t('Save settings')); + ], $this->t('Save and continue')); + $this->drupalPostForm(NULL, [], $this->t('Save field settings')); + $this->drupalPostForm(NULL, [], $this->t('Save settings')); $this->assertRaw('field_type_predicate', 'Redirected to "Manage fields" page.'); // Add the test node. $this->postNodeAddForm('test_type', [ 'title[0][value]' => 'Test Node', 'field_type_predicate[0][value]' => 'schema:Organization', - ], t('Save')); + ], $this->t('Save')); $this->assertSession()->pageTextContains("Test Node"); $url = $this->getUrl(); @@ -73,7 +73,7 @@ class JsonldTypeAlterReactionTest extends JsonldSelfReferenceReactionTest { $this->addCondition('test', 'islandora_entity_bundle'); $this->getSession()->getPage()->checkField("edit-conditions-islandora-entity-bundle-bundles-test-type"); $this->getSession()->getPage()->findById("edit-conditions-islandora-entity-bundle-context-mapping-node")->selectOption("@node.node_route_context:node"); - $this->getSession()->getPage()->pressButton(t('Save and continue')); + $this->getSession()->getPage()->pressButton($this->t('Save and continue')); // The first time a Context is saved, you need to clear the cache. // Subsequent changes to the context don't need a cache rebuild, though. diff --git a/tests/src/Functional/ViewModeAlterReactionTest.php b/tests/src/Functional/ViewModeAlterReactionTest.php index 14f26032..72cdfe44 100644 --- a/tests/src/Functional/ViewModeAlterReactionTest.php +++ b/tests/src/Functional/ViewModeAlterReactionTest.php @@ -75,7 +75,7 @@ class ViewModeAlterReactionTest extends IslandoraFunctionalTestBase { $this->drupalGet("admin/structure/context/test/reaction/add/view_mode_alter"); $this->getSession()->getPage()->findById("edit-reactions-view-mode-alter-mode")->selectOption('node.teaser'); - $this->getSession()->getPage()->pressButton(t('Save and continue')); + $this->getSession()->getPage()->pressButton($this->t('Save and continue')); $this->assertSession()->statusCodeEquals(200); drupal_flush_all_caches();