expects(self::once())->method('hasSelectedServer')->willReturn(false); $dbi = $this->createDatabaseInterface(); $config = new Config(); $responseRenderer = new ResponseRenderer(); $authentication = new Authentication( $configMock, new Template($config), ResponseFactory::create(), new AuthenticationPluginFactory($responseRenderer), $dbi, new Relation($dbi, $config), $responseRenderer, ); $response = self::createStub(ResponseInterface::class); $handler = self::createStub(RequestHandlerInterface::class); $handler->method('handle')->willReturn($response); $request = ServerRequestFactory::create()->createServerRequest('POST', 'https://example.com/'); self::assertSame($response, $authentication->process($request, $handler)); } }