function ReverseProxyMiddlewareTest::testReverseProxyEnabled

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php \Drupal\Tests\Core\StackMiddleware\ReverseProxyMiddlewareTest::testReverseProxyEnabled()
  2. 8.9.x core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php \Drupal\Tests\Core\StackMiddleware\ReverseProxyMiddlewareTest::testReverseProxyEnabled()
  3. 11.x core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php \Drupal\Tests\Core\StackMiddleware\ReverseProxyMiddlewareTest::testReverseProxyEnabled()

Tests that subscriber sets trusted headers when reverse proxy is set.

@dataProvider reverseProxyEnabledProvider

File

core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php, line 62

Class

ReverseProxyMiddlewareTest
Unit test the reverse proxy stack middleware.

Namespace

Drupal\Tests\Core\StackMiddleware

Code

public function testReverseProxyEnabled($provided_settings, $expected_trusted_header_set) : void {
    // Enable reverse proxy and add test values.
    $settings = new Settings([
        'reverse_proxy' => 1,
    ] + $provided_settings);
    $this->trustedHeadersAreSet($settings, $expected_trusted_header_set);
}

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