setValue(null, $responseStub); $request = self::createStub(ServerRequest::class); $request->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); (new ReflectionProperty(ResponseRenderer::class, 'instance'))->setValue(null, null); } }