You are here

public function HtaccessTest::testSvgzContentEncoding in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/System/HtaccessTest.php \Drupal\Tests\system\Functional\System\HtaccessTest::testSvgzContentEncoding()

Tests that SVGZ files are served with Content-Encoding: gzip.

File

core/modules/system/tests/src/Functional/System/HtaccessTest.php, line 152

Class

HtaccessTest
Tests .htaccess is working correctly.

Namespace

Drupal\Tests\system\Functional\System

Code

public function testSvgzContentEncoding() {
  $this
    ->drupalGet('core/modules/system/tests/logo.svgz');
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Use x-encoded-content-encoding because of Content-Encoding responses
  // (gzip, deflate, etc.) are automatically decoded by Guzzle.
  $this
    ->assertSession()
    ->responseHeaderEquals('x-encoded-content-encoding', 'gzip');
}