1111
1212namespace Http \Adapter \Tests ;
1313
14- use Http \Adapter \ HttpAdapter ;
15- use Http \Adapter \ HttpAdapterException ;
16- use Http \Adapter \Exception \MultiHttpAdapterException ;
14+ use Http \Client \ HttpClient ;
15+ use Http \Client \ Exception \ RequestException ;
16+ use Http \Client \Exception \BatchException ;
1717use Http \Message \MessageFactory ;
1818use Http \Discovery \MessageFactoryDiscovery ;
1919use Nerd \CartesianProduct \CartesianProduct ;
@@ -36,7 +36,7 @@ abstract class HttpAdapterTest extends \PHPUnit_Framework_TestCase
3636 protected static $ messageFactory ;
3737
3838 /**
39- * @var HttpAdapter
39+ * @var HttpClient
4040 */
4141 protected $ httpAdapter ;
4242
@@ -97,7 +97,7 @@ protected function tearDown()
9797 abstract public function testGetName ();
9898
9999 /**
100- * @return HttpAdapter
100+ * @return HttpClient
101101 */
102102 abstract protected function createHttpAdapter ();
103103
@@ -157,7 +157,7 @@ public function testSendRequestWithOutcome($uriAndOutcome, $protocolVersion, arr
157157 }
158158
159159 /**
160- * @expectedException \Http\Adapter \Exception\HttpAdapterException
160+ * @expectedException \Http\Client \Exception
161161 * @group integration
162162 */
163163 public function testSendWithInvalidUri ()
@@ -178,9 +178,9 @@ public function testSendWithInvalidUri()
178178 */
179179 public function testSendRequests (array $ requests )
180180 {
181- $ responses = $ this ->httpAdapter ->sendRequests ($ requests );
181+ $ batchResult = $ this ->httpAdapter ->sendRequests ($ requests );
182182
183- $ this ->assertMultiResponses ($ responses , $ requests );
183+ $ this ->assertMultiResponses ($ batchResult -> getResponses () , $ requests );
184184 }
185185
186186 /**
@@ -192,9 +192,9 @@ public function testSendErroredRequests(array $requests, array $erroredRequests)
192192 try {
193193 $ this ->httpAdapter ->sendRequests (array_merge ($ requests , $ erroredRequests ));
194194 $ this ->fail ();
195- } catch (MultiHttpAdapterException $ e ) {
196- $ this ->assertMultiResponses ($ e ->getResponses (), $ requests );
197- $ this ->assertMultiExceptions ($ e ->getExceptions (), $ erroredRequests );
195+ } catch (BatchException $ e ) {
196+ $ this ->assertMultiResponses ($ e ->getResult ()-> getResponses (), $ requests );
197+ $ this ->assertMultiExceptions ($ e ->getResult ()-> getExceptions (), $ erroredRequests );
198198 }
199199 }
200200
@@ -470,15 +470,14 @@ private function assertMultiResponses(array $responses, array $requests)
470470 }
471471
472472 /**
473- * @param HttpAdapterException [] $exceptions
474- * @param array $requests
473+ * @param RequestException [] $exceptions
474+ * @param array $requests
475475 */
476476 private function assertMultiExceptions (array $ exceptions , array $ requests )
477477 {
478478 $ this ->assertCount (count ($ requests ), $ exceptions );
479479
480480 foreach ($ exceptions as $ exception ) {
481- $ this ->assertTrue ($ exception ->hasRequest ());
482481 $ this ->assertInstanceOf (
483482 'Psr\Http\Message\RequestInterface ' ,
484483 $ exception ->getRequest ()
0 commit comments