Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 0482ade

Browse files
committed
Provide test case for non domain exception being handled
1 parent 534dfd5 commit 0482ade

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/Guzzle6PromiseTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Http\Adapter\Tests;
4+
5+
use GuzzleHttp\Exception as GuzzleExceptions;
6+
use GuzzleHttp\Promise\RejectedPromise;
7+
use Http\Adapter\Guzzle6Promise;
8+
9+
/**
10+
* @author Márk Sági-Kazár <[email protected]>
11+
*/
12+
class Guzzle6PromiseTest extends \PHPUnit_Framework_TestCase
13+
{
14+
/**
15+
* @expectedException \Exception
16+
*/
17+
public function testNonDomainExceptionIsHandled()
18+
{
19+
$request = $this->prophesize('Psr\Http\Message\RequestInterface');
20+
$promise = new RejectedPromise(new \Exception());
21+
22+
$guzzlePromise = new Guzzle6Promise($promise, $request->reveal());
23+
24+
$guzzlePromise->wait();
25+
}
26+
}

0 commit comments

Comments
 (0)