mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-23 17:44:02 +01:00
26 lines
764 B
PHP
26 lines
764 B
PHP
<?php
|
|
namespace GuzzleHttp\Tests\Exception;
|
|
|
|
use GuzzleHttp\Exception\ConnectException;
|
|
use GuzzleHttp\Psr7\Request;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* @covers \GuzzleHttp\Exception\ConnectException
|
|
*/
|
|
class ConnectExceptionTest extends TestCase
|
|
{
|
|
public function testHasNoResponse()
|
|
{
|
|
$req = new Request('GET', '/');
|
|
$prev = new \Exception();
|
|
$e = new ConnectException('foo', $req, $prev, ['foo' => 'bar']);
|
|
self::assertSame($req, $e->getRequest());
|
|
self::assertNull($e->getResponse());
|
|
self::assertFalse($e->hasResponse());
|
|
self::assertSame('foo', $e->getMessage());
|
|
self::assertSame('bar', $e->getHandlerContext()['foo']);
|
|
self::assertSame($prev, $e->getPrevious());
|
|
}
|
|
}
|