Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / FunctionalTests / Routing / DefaultFormatTest.php
diff --git a/web/core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php b/web/core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php
new file mode 100644 (file)
index 0000000..bf695d6
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+namespace Drupal\FunctionalTests\Routing;
+
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * @group routing
+ */
+class DefaultFormatTest extends BrowserTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['system', 'default_format_test'];
+
+  public function testFoo() {
+    $this->drupalGet('/default_format_test/human');
+    $this->assertSame('format:html', $this->getSession()->getPage()->getContent());
+    $this->assertSame('MISS', $this->drupalGetHeader('X-Drupal-Cache'));
+
+    $this->drupalGet('/default_format_test/machine');
+    $this->assertSame('format:json', $this->getSession()->getPage()->getContent());
+    $this->assertSame('MISS', $this->drupalGetHeader('X-Drupal-Cache'));
+  }
+
+  public function testMultipleRoutesWithSameSingleFormat() {
+    $this->drupalGet('/default_format_test/machine');
+    $this->assertSame('format:json', $this->getSession()->getPage()->getContent());
+  }
+
+}