Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / layout_discovery / tests / src / Kernel / LayoutTest.php
index c04785055e9b54e74aad336d041e5077ce0c4f5c..c7be49ba2b1571108582a0b2b0aef9ac731c0084 100644 (file)
@@ -33,6 +33,17 @@ class LayoutTest extends KernelTestBase {
     $this->layoutPluginManager = $this->container->get('plugin.manager.core.layout');
   }
 
+  /**
+   * Tests that a layout provided by a theme has the preprocess function set.
+   */
+  public function testThemeProvidedLayout() {
+    $this->container->get('theme_installer')->install(['test_layout_theme']);
+    $this->config('system.theme')->set('default', 'test_layout_theme')->save();
+
+    $theme_definitions = $this->container->get('theme.registry')->get();
+    $this->assertTrue(in_array('template_preprocess_layout', $theme_definitions['test_layout_theme']['preprocess functions']));
+  }
+
   /**
    * Test rendering a layout.
    *