function DefaultFormatTest::testFoo

Same name and namespace in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php \Drupal\FunctionalTests\Routing\DefaultFormatTest::testFoo()
  2. 10 core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php \Drupal\FunctionalTests\Routing\DefaultFormatTest::testFoo()
  3. 11.x core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php \Drupal\FunctionalTests\Routing\DefaultFormatTest::testFoo()

File

core/tests/Drupal/FunctionalTests/Routing/DefaultFormatTest.php, line 22

Class

DefaultFormatTest
@group routing

Namespace

Drupal\FunctionalTests\Routing

Code

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/human');
    $this->assertSame('format:html', $this->getSession()
        ->getPage()
        ->getContent());
    $this->assertSame('HIT', $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'));
    $this->drupalGet('/default_format_test/machine');
    $this->assertSame('format:json', $this->getSession()
        ->getPage()
        ->getContent());
    $this->assertSame('HIT', $this->drupalGetHeader('X-Drupal-Cache'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.