You are here

public function AccessResultTest::testCacheMaxAge in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Access/AccessResultTest.php \Drupal\Tests\Core\Access\AccessResultTest::testCacheMaxAge()
  2. 10 core/tests/Drupal/Tests/Core/Access/AccessResultTest.php \Drupal\Tests\Core\Access\AccessResultTest::testCacheMaxAge()

@covers ::setCacheMaxAge @covers ::getCacheMaxAge

File

core/tests/Drupal/Tests/Core/Access/AccessResultTest.php, line 390
Contains \Drupal\Tests\Core\Access\AccessResultTest.

Class

AccessResultTest
@coversDefaultClass \Drupal\Core\Access\AccessResult @group Access

Namespace

Drupal\Tests\Core\Access

Code

public function testCacheMaxAge() {
  $this
    ->assertSame(Cache::PERMANENT, AccessResult::neutral()
    ->getCacheMaxAge());
  $this
    ->assertSame(1337, AccessResult::neutral()
    ->setCacheMaxAge(1337)
    ->getCacheMaxAge());
}