Security update for Core, with self-updated composer
[yaffs-website] / web / core / tests / Drupal / KernelTests / Core / Render / RenderTest.php
index a64b553a16dd581cfbbfe20b47dc7d866e962a9b..2acaefb873b62b80272d495704b5297c99234b36 100644 (file)
@@ -16,7 +16,7 @@ class RenderTest extends KernelTestBase {
    *
    * @var array
    */
-  public static $modules = ['system', 'common_test'];
+  public static $modules = ['system', 'common_test', 'theme_test'];
 
   /**
    * Tests theme preprocess functions being able to attach assets.
@@ -43,6 +43,23 @@ class RenderTest extends KernelTestBase {
     \Drupal::state()->set('theme_preprocess_attached_test', FALSE);
   }
 
+  /**
+   * Ensures that render array children are processed correctly.
+   */
+  public function testRenderChildren() {
+    // Ensure that #prefix and #suffix is only being printed once since that is
+    // the behaviour the caller code expects.
+    $build = [
+      '#type' => 'container',
+      '#theme' => 'theme_test_render_element_children',
+      '#prefix' => 'kangaroo',
+      '#suffix' => 'kitten',
+    ];
+    $this->render($build);
+    $this->removeWhiteSpace();
+    $this->assertNoRaw('<div>kangarookitten</div>');
+  }
+
   /**
    * Tests that we get an exception when we try to attach an illegal type.
    */