function TrustedRedirectResponseTest::providerCreateFromRedirectResponse

Return value

array

File

core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php, line 76

Class

TrustedRedirectResponseTest
@coversDefaultClass \Drupal\Core\Routing\TrustedRedirectResponse[[api-linebreak]] @group Routing

Namespace

Drupal\Tests\Core\Routing

Code

public function providerCreateFromRedirectResponse() {
  return [
    'cacheable-with-tags' => [
      (new CacheableRedirectResponse('/example'))->addCacheableDependency((new CacheableMetadata())->addCacheTags([
        'foo',
      ])),
    ],
    'cacheable-with-max-age-0' => [
      (new CacheableRedirectResponse('/example'))->addCacheableDependency((new CacheableMetadata())->setCacheMaxAge(0)),
    ],
    'uncacheable' => [
      new RedirectResponse('/example'),
    ],
  ];
}

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