class MaintenanceModeResolverTest extends TestCase
{ public function testIsClientAllowedTriggersEventAndReturnsFalseForDisallowedClient(): void
{ $eventDispatcher =
$this->
createMock(EventDispatcherInterface::
class);
$eventDispatcher->
expects(static::
once()) ->
method('dispatch'
) ->
with(static::
isInstanceOf(MaintenanceModeRequestEvent::
class));
$resolver =
new MaintenanceModeResolver($eventDispatcher);
static::
assertFalse($resolver->
isClientAllowed(new Request(server:
['REMOTE_ADDR' => '192.168.0.4'
]),
[]));
} public function testIsClientAllowedTriggersEventAndReturnsTrueForAllowedClient(): void
{ $eventDispatcher =
$this->
createMock(EventDispatcherInterface::
class);
$eventDispatcher->
expects(static::
once()) ->
method('dispatch'
) ->
with(static::
isInstanceOf(MaintenanceModeRequestEvent::
class));
$resolver =
new MaintenanceModeResolver($eventDispatcher);