Version 1
[yaffs-website] / web / core / modules / system / tests / src / Functional / Render / DisplayVariantTest.php
diff --git a/web/core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php b/web/core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php
new file mode 100644 (file)
index 0000000..2f5415b
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+namespace Drupal\Tests\system\Functional\Render;
+
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Tests selecting a display variant.
+ *
+ * @group Render
+ */
+class DisplayVariantTest extends BrowserTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['display_variant_test'];
+
+  /**
+   * Tests selecting the variant and passing configuration.
+   */
+  public function testPageDisplayVariantSelectionEvent() {
+    // Tests that our display variant was selected, and that its configuration
+    // was passed correctly. If the configuration wasn't passed, we'd get an
+    // error page here.
+    $this->drupalGet('<front>');
+    $this->assertRaw('A very important, required value.');
+    $this->assertRaw('Explicitly passed in context.');
+    $this->assertCacheTag('custom_cache_tag');
+  }
+
+}