annotate core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php @ 5:12f9dff5fda9
tip
Update to Drupal core 8.7.1
author |
Chris Cannam |
date |
Thu, 09 May 2019 15:34:47 +0100 |
parents |
c75dbcec494b |
children |
|
rev |
line source |
Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\FunctionalTests\Routing;
|
Chris@0
|
4
|
Chris@0
|
5 use Drupal\Tests\BrowserTestBase;
|
Chris@0
|
6
|
Chris@0
|
7 /**
|
Chris@0
|
8 * @group routing
|
Chris@0
|
9 */
|
Chris@0
|
10 class DefaultFormatTest extends BrowserTestBase {
|
Chris@0
|
11
|
Chris@0
|
12 /**
|
Chris@0
|
13 * {@inheritdoc}
|
Chris@0
|
14 */
|
Chris@0
|
15 public static $modules = ['system', 'default_format_test'];
|
Chris@0
|
16
|
Chris@0
|
17 public function testFoo() {
|
Chris@0
|
18 $this->drupalGet('/default_format_test/human');
|
Chris@0
|
19 $this->assertSame('format:html', $this->getSession()->getPage()->getContent());
|
Chris@0
|
20 $this->assertSame('MISS', $this->drupalGetHeader('X-Drupal-Cache'));
|
Chris@5
|
21 $this->drupalGet('/default_format_test/human');
|
Chris@5
|
22 $this->assertSame('format:html', $this->getSession()->getPage()->getContent());
|
Chris@5
|
23 $this->assertSame('HIT', $this->drupalGetHeader('X-Drupal-Cache'));
|
Chris@0
|
24
|
Chris@0
|
25 $this->drupalGet('/default_format_test/machine');
|
Chris@0
|
26 $this->assertSame('format:json', $this->getSession()->getPage()->getContent());
|
Chris@0
|
27 $this->assertSame('MISS', $this->drupalGetHeader('X-Drupal-Cache'));
|
Chris@5
|
28 $this->drupalGet('/default_format_test/machine');
|
Chris@5
|
29 $this->assertSame('format:json', $this->getSession()->getPage()->getContent());
|
Chris@5
|
30 $this->assertSame('HIT', $this->drupalGetHeader('X-Drupal-Cache'));
|
Chris@0
|
31 }
|
Chris@0
|
32
|
Chris@0
|
33 public function testMultipleRoutesWithSameSingleFormat() {
|
Chris@0
|
34 $this->drupalGet('/default_format_test/machine');
|
Chris@0
|
35 $this->assertSame('format:json', $this->getSession()->getPage()->getContent());
|
Chris@0
|
36 }
|
Chris@0
|
37
|
Chris@0
|
38 }
|