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