diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php index c21410f2bc..a434858a7c 100644 --- a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php @@ -316,8 +316,8 @@ 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'); - $this->assertNotIdentical(FALSE, strpos($form_class->getAttribute('class'), 'error'), 'The string was rejected as unsafe.'); + $form_class = $this->xpath('//form[@id="locale-translate-edit-form"]//textarea/@class'); + $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.'); } }