public function TrustedRedirectResponseTest::providerCreateFromRedirectResponse in Drupal 9
Same name and namespace in other branches
- 8 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\RoutingCode
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'),
],
];
}