public function testShouldRedirect(Request
$request, bool
$shouldRedirect): void
{ /*
* Usually the resolver could be instantiated in the setUp method, but
* we need to be able to set the master-request's config here, since
* the resolver reads the whitelist from it.
*/
$resolver =
new MaintenanceModeResolver($this->
getRequestStack($request),
new CoreMaintenanceModeResolver(new EventDispatcher()));
if ($shouldRedirect) { static::
assertTrue( $resolver->
shouldRedirect($request),
'Expected to be redirected to the maintenance page, but shouldRedirect returned false.'
);
} else { static::
assertFalse( $resolver->
shouldRedirect($request),
'Didn\'t expect to be redirected to the maintenance page, but shouldRedirect returned true.'
);
} } /**
* Tests if the resolver redirects requests from the maintenance page to the shop correctly.
*
* @dataProvider maintenanceModeInactiveProvider
* @dataProvider maintenanceModeActiveProvider
*/