@@ -350,50 +350,6 @@ public function testAdapterAlwaysReachableIfSpecified()
350350 $ this ->assertSame ($ testAdapter , $ client ->getAdapter ());
351351 }
352352
353- /**
354- * Custom response object is set but still invalid code coming back
355- * @expectedException Zend\Http\Exception\InvalidArgumentException
356- */
357- public function testUsageOfCustomResponseInvalidCode ()
358- {
359- require_once (dirname (realpath (__FILE__ )) . DIRECTORY_SEPARATOR .'_files ' . DIRECTORY_SEPARATOR . 'CustomResponse.php ' );
360- $ testAdapter = new Test ();
361- $ testAdapter ->setResponse (
362- "HTTP/1.1 496 CustomResponse \r\n\r\n"
363- . "Whatever content "
364- );
365-
366- $ client = new Client ('http://www.example.org/ ' , array (
367- 'adapter ' => $ testAdapter ,
368- ));
369- $ client ->setResponse (new CustomResponse ());
370- $ response = $ client ->send ();
371- }
372-
373- /**
374- * Custom response object is set with defined status code 497.
375- * Should not throw an exception.
376- */
377- public function testUsageOfCustomResponseCustomCode ()
378- {
379- require_once (dirname (realpath (__FILE__ )) . DIRECTORY_SEPARATOR .'_files ' . DIRECTORY_SEPARATOR . 'CustomResponse.php ' );
380- $ testAdapter = new Test ();
381- $ testAdapter ->setResponse (
382- "HTTP/1.1 497 CustomResponse \r\n\r\n"
383- . "Whatever content "
384- );
385-
386- $ client = new Client ('http://www.example.org/ ' , array (
387- 'adapter ' => $ testAdapter ,
388- ));
389- $ client ->setResponse (new CustomResponse ());
390- $ response = $ client ->send ();
391-
392- $ this ->assertInstanceOf ('ZendTest\Http\CustomResponse ' , $ response );
393- $ this ->assertEquals (497 , $ response ->getStatusCode ());
394- $ this ->assertEquals ('Whatever content ' , $ response ->getContent ());
395- }
396-
397353 public function testPrepareHeadersCreateRightHttpField ()
398354 {
399355 $ body = json_encode (array ('foofoo ' =>'barbar ' ));
0 commit comments