function HtaccessTest::testSvgzContentEncoding

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/System/HtaccessTest.php \Drupal\Tests\system\Functional\System\HtaccessTest::testSvgzContentEncoding()
  2. 8.9.x core/modules/system/tests/src/Functional/System/HtaccessTest.php \Drupal\Tests\system\Functional\System\HtaccessTest::testSvgzContentEncoding()
  3. 11.x 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 158

Class

HtaccessTest
Tests .htaccess is working correctly.

Namespace

Drupal\Tests\system\Functional\System

Code

public function testSvgzContentEncoding() : void {
    $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');
}

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