本文整理汇总了PHP中Monolog\Handler\TestHandler::hasError方法的典型用法代码示例。如果您正苦于以下问题:PHP TestHandler::hasError方法的具体用法?PHP TestHandler::hasError怎么用?PHP TestHandler::hasError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Monolog\Handler\TestHandler
的用法示例。
在下文中一共展示了TestHandler::hasError方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSoapClientInstanceBadCallWithMultipleEndpoints
/**
* @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'));
}