You are here

public function TrustedRedirectResponseTest::providerCreateFromRedirectResponse in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Routing/TrustedRedirectResponseTest.php \Drupal\Tests\Core\Routing\TrustedRedirectResponseTest::providerCreateFromRedirectResponse()

Return value

array

File

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

Class

TrustedRedirectResponseTest
@coversDefaultClass \Drupal\Core\Routing\TrustedRedirectResponse @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'),
    ],
  ];
}