function ContentLengthTest::providerTestSetContentLengthHeader

Same name in this branch
  1. 10 core/tests/Drupal/Tests/Core/StackMiddleware/ContentLengthTest.php \Drupal\Tests\Core\StackMiddleware\ContentLengthTest::providerTestSetContentLengthHeader()
Same name in other branches
  1. 11.x core/modules/big_pipe/tests/src/Unit/StackMiddleware/ContentLengthTest.php \Drupal\Tests\big_pipe\Unit\StackMiddleware\ContentLengthTest::providerTestSetContentLengthHeader()
  2. 11.x core/tests/Drupal/Tests/Core/StackMiddleware/ContentLengthTest.php \Drupal\Tests\Core\StackMiddleware\ContentLengthTest::providerTestSetContentLengthHeader()

File

core/modules/big_pipe/tests/src/Unit/StackMiddleware/ContentLengthTest.php, line 40

Class

ContentLengthTest
Defines a test for ContentLength middleware.

Namespace

Drupal\Tests\big_pipe\Unit\StackMiddleware

Code

public static function providerTestSetContentLengthHeader() {
    $response = new Response('Test content', 200);
    $response->headers
        ->set('Content-Length', (string) strlen('Test content'));
    return [
        '200 ok' => [
            12,
            $response,
        ],
        'Big pipe' => [
            FALSE,
            new BigPipeResponse(new HtmlResponse('Test content')),
        ],
    ];
}

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