X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FKernel%2FTheme%2FTwigFilterTest.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FKernel%2FTheme%2FTwigFilterTest.php;h=c1c26dd032ca59afa8e0df9a8cc6539d1c5cfb14;hp=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/system/tests/src/Kernel/Theme/TwigFilterTest.php b/web/core/modules/system/tests/src/Kernel/Theme/TwigFilterTest.php new file mode 100644 index 000000000..c1c26dd03 --- /dev/null +++ b/web/core/modules/system/tests/src/Kernel/Theme/TwigFilterTest.php @@ -0,0 +1,123 @@ + 'twig_theme_test_filter', + '#quote' => [ + 'content' => ['#markup' => 'You can only find truth with logic if you have already found truth without it.'], + 'author' => ['#markup' => 'Gilbert Keith Chesterton'], + 'date' => ['#markup' => '1874-1936'], + ], + '#attributes' => [ + 'id' => 'quotes', + 'checked' => TRUE, + 'class' => ['red', 'green', 'blue'], + ], + ]; + $rendered = \Drupal::service('renderer')->renderRoot($filter_test); + $this->setRawContent($rendered); + + $elements = [ + [ + 'expected' => '
+', + 'message' => '"Marked-up quote" was successfully rendered.', + ], + [ + 'expected' => 'You can only find truth with logic if you have already found truth without it.
+ +