function AccessResultTest::testCacheMaxAge

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Access/AccessResultTest.php \Drupal\Tests\Core\Access\AccessResultTest::testCacheMaxAge()
  2. 8.9.x core/tests/Drupal/Tests/Core/Access/AccessResultTest.php \Drupal\Tests\Core\Access\AccessResultTest::testCacheMaxAge()
  3. 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 388

Class

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

Namespace

Drupal\Tests\Core\Access

Code

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

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