X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FFunctional%2FBootstrap%2FDrupalMessengerServiceTest.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FFunctional%2FBootstrap%2FDrupalMessengerServiceTest.php;h=51404ef18d17a9bc61252814918331853a5a90f3;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=0000000000000000000000000000000000000000;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website
diff --git a/web/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php b/web/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
new file mode 100644
index 000000000..51404ef18
--- /dev/null
+++ b/web/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
@@ -0,0 +1,49 @@
+drupalGet(Url::fromRoute('system_test.messenger_service'));
+ $this->assertNoText('First message (removed).');
+ $this->assertRaw(t('Second message with markup! (not removed).'));
+
+ // Ensure duplicate messages are handled as expected.
+ $this->assertUniqueText('Non Duplicated message');
+ $this->assertNoUniqueText('Duplicated message');
+
+ // Ensure Markup objects are rendered as expected.
+ $this->assertRaw('Markup with markup!');
+ $this->assertUniqueText('Markup with markup!');
+ $this->assertRaw('Markup2 with markup!');
+
+ // Ensure when the same message is of different types it is not duplicated.
+ $this->assertUniqueText('Non duplicate Markup / string.');
+ $this->assertNoUniqueText('Duplicate Markup / string.');
+
+ // Ensure that strings that are not marked as safe are escaped.
+ $this->assertEscaped('Thismarkup will be escaped.');
+ }
+
+}