method('isPost')->willReturn(true); $authPlugin = self::createMock(AuthenticationPlugin::class); $authPlugin->expects(self::once())->method('logOut'); $factory = self::createStub(AuthenticationPluginFactory::class); $factory->method('create')->willReturn($authPlugin); (new LogoutController($factory))($request); unset($GLOBALS['token_mismatch']); } }