/** * @throws \Exception * @throws \InvalidArgumentException * @throws \WebservicesNl\Common\Exception\Server\NoServerAvailableException * @throws \WebservicesNl\Common\Exception\Client\InputException * @throws \SoapFault */ public function testSoapClientInstanceBadCallWithMultipleEndpoints() { $manager = new Manager(); $manager->createEndpoint('https://ws1.webservices.nl/soap_doclit'); $manager->createEndpoint('https://ws2.webservices.nl/soap_doclit'); // Create a mock and queue a bad and successful response. $mock = new MockHandler([new ConnectException('Error Communicating with Server', new Request('GET', 'login')), new Response(202, ['Content-Length' => 0])]); $handler = HandlerStack::create($mock); $curlClient = new Client(['handler' => $handler]); $instance = new SoapClient($this->settings, $manager, $curlClient); $instance->setLogger($this->logger); $instance->call(['functionName' => 'login']); static::assertTrue($manager->getEndpoints()->first()->isError()); static::assertTrue($this->testHandler->hasError('Endpoint is not responding')); }