diff --git a/core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php similarity index 98% rename from core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php rename to core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php index 479a60046b..9187bf0c0d 100644 --- a/core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php @@ -1,9 +1,9 @@ drupalPostForm('admin/config/regional/translate', $search, t('Filter')); $textareas = $this->xpath('//textarea'); $textarea = current($textareas); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => '', ]; diff --git a/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php similarity index 96% rename from core/modules/locale/src/Tests/LocaleConfigTranslationTest.php rename to core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php index a90dce0c54..cfef00852f 100644 --- a/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php @@ -1,8 +1,8 @@ drupalPostForm('admin/config/regional/translate', $search, t('Filter')); $textareas = $this->xpath('//textarea'); $textarea = current($textareas); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $message, ]; @@ -100,7 +100,7 @@ public function testConfigTranslation() { $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter')); $textareas = $this->xpath('//textarea'); $textarea = current($textareas); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => 'D', ]; @@ -143,7 +143,7 @@ public function testConfigTranslation() { ]; $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter')); $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $image_style_label, ]; @@ -175,7 +175,7 @@ public function testConfigTranslation() { ]; $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter')); $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $category_label, ]; diff --git a/core/modules/locale/src/Tests/LocaleExportTest.php b/core/modules/locale/tests/src/Functional/LocaleExportTest.php similarity index 97% rename from core/modules/locale/src/Tests/LocaleExportTest.php rename to core/modules/locale/tests/src/Functional/LocaleExportTest.php index 54d36e2bc8..05621f6c13 100644 --- a/core/modules/locale/src/Tests/LocaleExportTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleExportTest.php @@ -1,15 +1,15 @@ get('locale.translation.javascript'); $js_filename = $prefix . '_' . $js_translation_files[$prefix] . '.js'; + $content = $this->getSession()->getPage()->getcontent(); // Assert translations JS is included before drupal.js. - $this->assertTrue(strpos($this->content, $js_filename) < strpos($this->content, 'core/misc/drupal.js'), 'Translations are included before Drupal.t.'); + $this->assertTrue(strpos($content, $js_filename) < strpos($content, 'core/misc/drupal.js'), 'Translations are included before Drupal.t.'); } } diff --git a/core/modules/locale/src/Tests/LocaleLibraryAlterTest.php b/core/modules/locale/tests/src/Functional/LocaleLibraryAlterTest.php similarity index 85% rename from core/modules/locale/src/Tests/LocaleLibraryAlterTest.php rename to core/modules/locale/tests/src/Functional/LocaleLibraryAlterTest.php index 68996f44a2..5425fc5f4c 100644 --- a/core/modules/locale/src/Tests/LocaleLibraryAlterTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleLibraryAlterTest.php @@ -1,9 +1,9 @@ xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $translation, ]; @@ -112,7 +112,7 @@ public function testStringTranslation() { ]; $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter')); $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $translation_to_en, ]; @@ -155,7 +155,7 @@ public function testStringTranslation() { ]; $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter')); $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => 'Please enter your Llama username.', ]; @@ -189,7 +189,7 @@ public function testStringTranslation() { $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter')); // Assume this is the only result, given the random name. $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => '', ]; @@ -248,7 +248,7 @@ public function testJavaScriptTranslation() { $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter')); $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $this->randomMachineName(), ]; @@ -309,7 +309,7 @@ public function testStringValidation() { // Find the edit path. $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); foreach ($bad_translations as $translation) { $edit = [ $lid => $translation, @@ -317,7 +317,7 @@ public function testStringValidation() { $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations')); // Check for a form error on the textarea. $form_class = $this->xpath('//form[@id="locale-translate-edit-form"]//textarea/@class'); - $this->assertNotIdentical(FALSE, strpos($form_class[0], 'error'), 'The string was rejected as unsafe.'); + $this->assertNotIdentical(FALSE, strpos($form_class[0]->getText(), 'error'), 'The string was rejected as unsafe.'); $this->assertNoText(t('The string has been saved.'), 'The string was not saved.'); } } @@ -399,7 +399,7 @@ public function testStringSearch() { // Assume this is the only result, given the random name. // We save the lid from the path. $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $translation, ]; @@ -503,7 +503,7 @@ public function testUICustomizedStrings() { // Submit the translations without changing the translation. $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $translation->getString(), ]; @@ -522,7 +522,7 @@ public function testUICustomizedStrings() { // Submit the translations with a new translation. $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $this->randomMachineName(100), ]; diff --git a/core/modules/locale/src/Tests/LocaleUpdateBase.php b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php similarity index 98% rename from core/modules/locale/src/Tests/LocaleUpdateBase.php rename to core/modules/locale/tests/src/Functional/LocaleUpdateBase.php index b228a962de..f4c59b2873 100644 --- a/core/modules/locale/src/Tests/LocaleUpdateBase.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php @@ -1,16 +1,16 @@