function HtaccessTest::testSvgzContentEncoding

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/System/HtaccessTest.php \Drupal\Tests\system\Functional\System\HtaccessTest::testSvgzContentEncoding()
  2. 10 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 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.
    $header = $this->drupalGetHeader('x-encoded-content-encoding');
    $this->assertEqual($header, 'gzip');
}

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