only in patch2: unchanged: --- a/core/modules/color/tests/modules/color_test/themes/color_test_theme/color/color.inc +++ b/core/modules/color/tests/modules/color_test/themes/color_test_theme/color/color.inc @@ -29,5 +29,5 @@ 'css' => [ 'css/colors.css', ], - 'preview_html' => 'color/preview.html', + 'preview_html' => 'color/preview.html.twig', ]; only in patch2: unchanged: --- a/core/modules/color/tests/modules/color_test/themes/color_test_theme/color/preview.html +++ /dev/null @@ -1,8 +0,0 @@ -
-
-

TEST COLOR PREVIEW

-

Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-
-
-
- only in patch2: unchanged: --- /dev/null +++ b/core/modules/color/tests/modules/color_test/themes/color_test_theme/color/preview.html.twig @@ -0,0 +1,8 @@ +
+
+

{% trans %}TEST COLOR PREVIEW{% endtrans %}

+

{% trans %}Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.{% endtrans %}

+
+
+
+ only in patch2: unchanged: --- a/core/modules/color/tests/src/Functional/ColorSafePreviewTest.php +++ b/core/modules/color/tests/src/Functional/ColorSafePreviewTest.php @@ -44,10 +44,11 @@ public function testColorPreview() { \Drupal::service('theme_handler')->install(['color_test_theme']); $this->drupalLogin($this->bigUser); - // Markup is being printed from a HTML file located in: - // core/modules/color/tests/modules/color_test/themes/color_test_theme/color/preview.html + // Markup is being printed from a TWIG file located in: + // core/modules/color/tests/modules/color_test/themes/color_test_theme/color/preview.html.twig $url = Url::fromRoute('system.theme_settings_theme', ['theme' => 'color_test_theme']); $this->drupalGet($url); + $this->assertText('TEST COLOR PREVIEW'); $this->assertNoRaw(''); only in patch2: unchanged: --- /dev/null +++ b/core/modules/color/tests/src/Functional/ColorTranslationPreviewTest.php @@ -0,0 +1,62 @@ +bigUser = $this->drupalCreateUser([ + 'administer themes', + ]); + $this->drupalLogin($this->bigUser); + // Install the color test theme. + \Drupal::service('theme_handler')->install(['color_test_theme']); + $this->config('system.theme')->set('default', 'color_test_theme')->save(); + $this->rebuildContainer(); + + } + + /** + * Ensuring the the text in the preview.html.twig file is wrapped with trans tag. + */ + public function testTranslationPreview() + { + + // Markup is being printed from a TWIG file located in: + // core/modules/color/tests/modules/color_test/themes/color_test_theme/color/preview.html.twig + $url_preview = 'core/modules/color/tests/modules/color_test/themes/color_test_theme/color/preview.html.twig'; + $this->preview = file_get_contents($url_preview); + $this->assertRegExp('/{% trans %}/', $this->preview); + $this->assertRegExp('/{% entrans %}/', $this->preview); + + } + +} \ No newline at end of file