From 3784def28765a08f6df616aa9fb91731000dccd5 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Fri, 8 Mar 2024 11:03:10 -0400 Subject: [PATCH] Tests use strings not translateable markup to select interface buttons. --- .../src/Functional/GenerateAudioDerivativeTest.php | 6 +++--- .../src/Functional/GenerateImageDerivativeTest.php | 6 +++--- .../src/Functional/GenerateVideoDerivativeTest.php | 6 +++--- tests/src/Functional/ContentEntityTypeTest.php | 2 +- tests/src/Functional/DerivativeReactionTest.php | 2 +- tests/src/Functional/EmitNodeEventTest.php | 2 +- tests/src/Functional/EntityBundleTest.php | 2 +- .../src/Functional/FormDisplayAlterReactionTest.php | 2 +- tests/src/Functional/IndexingTest.php | 2 +- tests/src/Functional/IslandoraSettingsFormTest.php | 10 +++++----- .../Functional/JsonldSelfReferenceReactionTest.php | 2 +- tests/src/Functional/JsonldTypeAlterReactionTest.php | 12 ++++++------ 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php b/modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php index 6b85cd1b..094a7856 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($this->t('Create')); + $this->getSession()->getPage()->pressButton('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($this->t('Save')); + $this->getSession()->getPage()->pressButton('Save'); $this->assertSession()->statusCodeEquals(200); // Create a context and add the action as a derivative reaction. @@ -69,7 +69,7 @@ class GenerateAudioDerivativeTest extends GenerateDerivativeTestBase { 'field_media_use[0][target_id]' => $this->preservationMasterTerm->label(), ]; $this->drupalGet('media/add/' . $this->testMediaType->id()); - $this->submitForm($values, $this->t('Save')); + $this->submitForm($values, 'Save'); $expected = [ 'source_uri' => 'test_file.txt', diff --git a/modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php b/modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php index 44cdda58..17c1beae 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($this->t('Create')); + $this->getSession()->getPage()->pressButton('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($this->t('Save')); + $this->getSession()->getPage()->pressButton('Save'); $this->assertSession()->statusCodeEquals(200); // Create a context and add the action as a derivative reaction. @@ -71,7 +71,7 @@ class GenerateImageDerivativeTest extends GenerateDerivativeTestBase { 'field_media_use[0][target_id]' => $this->preservationMasterTerm->label(), ]; $this->drupalGet('media/add/' . $this->testMediaType->id()); - $this->submitForm($values, $this->t('Save')); + $this->submitForm($values, 'Save'); $expected = [ 'source_uri' => 'test_file.txt', diff --git a/modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php b/modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php index de06ba2f..2f79e18e 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($this->t('Create')); + $this->getSession()->getPage()->pressButton('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($this->t('Save')); + $this->getSession()->getPage()->pressButton('Save'); $this->assertSession()->statusCodeEquals(200); // Create a context and add the action as a derivative reaction. @@ -66,7 +66,7 @@ class GenerateVideoDerivativeTest extends GenerateDerivativeTestBase { 'field_media_use[0][target_id]' => $this->preservationMasterTerm->label(), ]; $this->drupalGet('media/add/' . $this->testMediaType->id()); - $this->submitForm($values, $this->t('Save')); + $this->submitForm($values, 'Save'); $expected = [ 'source_uri' => 'test_file.txt', diff --git a/tests/src/Functional/ContentEntityTypeTest.php b/tests/src/Functional/ContentEntityTypeTest.php index 5ed22948..b753852a 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($this->t('Save and continue')); + $this->getSession()->getPage()->pressButton('Save and continue'); $this->addPresetReaction('test', 'index', 'hello_world'); // Create a new node confirm Hello World! is printed to the screen. diff --git a/tests/src/Functional/DerivativeReactionTest.php b/tests/src/Functional/DerivativeReactionTest.php index 00e0e5ae..7c0cedb3 100644 --- a/tests/src/Functional/DerivativeReactionTest.php +++ b/tests/src/Functional/DerivativeReactionTest.php @@ -53,7 +53,7 @@ class DerivativeReactionTest extends IslandoraFunctionalTestBase { 'field_media_of[0][target_id]' => 'Test Node', ]; $this->drupalGet('media/add/' . $this->testMediaType->id()); - $this->submitForm($values, $this->t('Save')); + $this->submitForm($values, 'Save'); // field_media_of is set and there's a file, so derivatives should fire. $this->assertSession()->pageTextContains("Hello World!"); diff --git a/tests/src/Functional/EmitNodeEventTest.php b/tests/src/Functional/EmitNodeEventTest.php index 83f062ae..3ebcc6dd 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($this->t('Save and continue')); + $this->getSession()->getPage()->pressButton('Save and continue'); $this->addPresetReaction('test', 'index', $action_id); $this->assertSession()->statusCodeEquals(200); diff --git a/tests/src/Functional/EntityBundleTest.php b/tests/src/Functional/EntityBundleTest.php index bde1ee40..27183826 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($this->t('Save and continue')); + $this->getSession()->getPage()->pressButton('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 d394b728..fe70aa64 100644 --- a/tests/src/Functional/FormDisplayAlterReactionTest.php +++ b/tests/src/Functional/FormDisplayAlterReactionTest.php @@ -49,7 +49,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($this->t('Save and continue')); + $this->getSession()->getPage()->pressButton('Save and continue'); $this->assertSession()->statusCodeEquals(200); drupal_flush_all_caches(); diff --git a/tests/src/Functional/IndexingTest.php b/tests/src/Functional/IndexingTest.php index ff215281..cf2dbb66 100644 --- a/tests/src/Functional/IndexingTest.php +++ b/tests/src/Functional/IndexingTest.php @@ -66,7 +66,7 @@ class IndexingTest extends IslandoraFunctionalTestBase { $this->drupalGet("$url/delete"); // Delete the node. - $this->submitForm([], $this->t('Delete')); + $this->submitForm([], 'Delete'); $this->assertSession()->statusCodeEquals(200); // Confirm Goodbye, Cruel World! is printed to the screen. diff --git a/tests/src/Functional/IslandoraSettingsFormTest.php b/tests/src/Functional/IslandoraSettingsFormTest.php index 80a327af..18bfcafb 100644 --- a/tests/src/Functional/IslandoraSettingsFormTest.php +++ b/tests/src/Functional/IslandoraSettingsFormTest.php @@ -38,23 +38,23 @@ class IslandoraSettingsFormTest extends IslandoraFunctionalTestBase { $this->assertSession()->fieldValueEquals('edit-jwt-expiry', '+2 hour'); $this->drupalGet('/admin/config/islandora/core'); // Blank is not allowed. - $this->submitForm(['edit-jwt-expiry' => ""], $this->t('Save configuration')); + $this->submitForm(['edit-jwt-expiry' => ""], 'Save configuration'); $this->assertSession()->pageTextContainsOnce('"" is not a valid time or interval expression.'); $this->drupalGet('/admin/config/islandora/core'); // Negative is not allowed. - $this->submitForm(['edit-jwt-expiry' => "-2 hours"], $this->t('Save configuration')); + $this->submitForm(['edit-jwt-expiry' => "-2 hours"], 'Save configuration'); $this->assertSession()->pageTextContainsOnce('Time or interval expression cannot be negative'); $this->drupalGet('/admin/config/islandora/core'); // Must include an integer value. - $this->submitForm(['edit-jwt-expiry' => "last hour"], $this->t('Save configuration')); + $this->submitForm(['edit-jwt-expiry' => "last hour"], 'Save configuration'); $this->assertSession()->pageTextContainsOnce('No numeric interval specified, for example "1 day"'); $this->drupalGet('/admin/config/islandora/core'); // Must have an accepted interval. - $this->submitForm(['edit-jwt-expiry' => "1 fortnight"], $this->t('Save configuration')); + $this->submitForm(['edit-jwt-expiry' => "1 fortnight"], 'Save configuration'); $this->assertSession()->pageTextContainsOnce('No time interval found, please include one of'); $this->drupalGet('/admin/config/islandora/core'); // Test a valid setting. - $this->submitForm(['edit-jwt-expiry' => "2 weeks"], $this->t('Save configuration')); + $this->submitForm(['edit-jwt-expiry' => "2 weeks"], '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 1b4e24ec..c8acfcc9 100644 --- a/tests/src/Functional/JsonldSelfReferenceReactionTest.php +++ b/tests/src/Functional/JsonldSelfReferenceReactionTest.php @@ -60,7 +60,7 @@ class JsonldSelfReferenceReactionTest extends IslandoraFunctionalTestBase { $this->postNodeAddForm('test_type', ['title[0][value]' => 'Test Node'], - $this->t('Save')); + 'Save'); $this->assertSession()->pageTextContains("Test Node"); $url = $this->getUrl(); diff --git a/tests/src/Functional/JsonldTypeAlterReactionTest.php b/tests/src/Functional/JsonldTypeAlterReactionTest.php index 75ae41dd..5ab9037c 100644 --- a/tests/src/Functional/JsonldTypeAlterReactionTest.php +++ b/tests/src/Functional/JsonldTypeAlterReactionTest.php @@ -32,7 +32,7 @@ class JsonldTypeAlterReactionTest extends JsonldSelfReferenceReactionTest { 'label' => 'Typed Predicate', 'field_name' => 'type_predicate', ], 'Save and continue'); - $this->submitForm([], $this->t('Save field settings')); + $this->submitForm([], 'Save field settings'); } else { $this->getSession()->getPage()->selectFieldOption('new_storage_type', 'plain_text'); @@ -46,7 +46,7 @@ class JsonldTypeAlterReactionTest extends JsonldSelfReferenceReactionTest { 'new_storage_type' => 'plain_text', 'label' => 'Typed Predicate', 'field_name' => 'type_predicate', - ], $this->t('Continue')); + ], 'Continue'); // Now we can proceed, selecting the plain text (i.e. string) // for the second element now that the element is displayed after @@ -57,16 +57,16 @@ class JsonldTypeAlterReactionTest extends JsonldSelfReferenceReactionTest { 'label' => 'Typed Predicate', 'field_name' => 'type_predicate', 'group_field_options_wrapper' => 'string', - ], $this->t('Continue')); + ], 'Continue'); } - $this->submitForm([], $this->t('Save settings')); + $this->submitForm([], 'Save settings'); $this->assertSession()->responseContains('field_type_predicate'); // Add the test node. $this->postNodeAddForm('test_type', [ 'title[0][value]' => 'Test Node', 'field_type_predicate[0][value]' => 'schema:Organization', - ], $this->t('Save')); + ], 'Save'); $this->assertSession()->pageTextContains("Test Node"); $url = $this->getUrl(); @@ -103,7 +103,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($this->t('Save and continue')); + $this->getSession()->getPage()->pressButton('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.