function DenyNoCacheRoutesTest::testDenyNoCacheRoutesPolicy

Asserts that caching is denied on the node preview route.

@dataProvider providerDenyNoCacheRoutesPolicy @covers ::check

File

core/tests/Drupal/Tests/Core/PageCache/DenyNoCacheRoutesTest.php, line 68

Class

DenyNoCacheRoutesTest
@coversDefaultClass \Drupal\Core\PageCache\ResponsePolicy\DenyNoCacheRoutes @group PageCache @group Route

Namespace

Drupal\Tests\Core\PageCache

Code

public function testDenyNoCacheRoutesPolicy($expected_result, ?Route $route) : void {
    $this->routeMatch
        ->expects($this->once())
        ->method('getRouteObject')
        ->willReturn($route);
    $actual_result = $this->policy
        ->check($this->response, $this->request);
    $this->assertSame($expected_result, $actual_result);
}

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