You are here

public function DenyNodePreviewTest::testPrivateImageStyleDownloadPolicy in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php \Drupal\Tests\node\Unit\PageCache\DenyNodePreviewTest::testPrivateImageStyleDownloadPolicy()

Asserts that caching is denied on the node preview route.

@dataProvider providerPrivateImageStyleDownloadPolicy @covers ::check

File

core/modules/node/tests/src/Unit/PageCache/DenyNodePreviewTest.php, line 63
Contains \Drupal\Tests\node\Unit\PageCache\DenyNodePreviewTest.

Class

DenyNodePreviewTest
@coversDefaultClass \Drupal\node\PageCache\DenyNodePreview @group node

Namespace

Drupal\Tests\node\Unit\PageCache

Code

public function testPrivateImageStyleDownloadPolicy($expected_result, $route_name) {
  $this->routeMatch
    ->expects($this
    ->once())
    ->method('getRouteName')
    ->will($this
    ->returnValue($route_name));
  $actual_result = $this->policy
    ->check($this->response, $this->request);
  $this
    ->assertSame($expected_result, $actual_result);
}