From c0cf5a6ff1fcfa67f5aff91de408de3a19bda5b3 Mon Sep 17 00:00:00 2001 From: Maks3w Date: Tue, 22 Oct 2013 12:19:00 +0200 Subject: [PATCH] [zendframework/zf2#5013] Remove custom code response tests Since zendframework/zf2#5013 custom response codes can be assigned directly without need to extend the class. --- test/ClientTest.php | 44 ---------------------------------- test/_files/CustomResponse.php | 7 ------ 2 files changed, 51 deletions(-) delete mode 100644 test/_files/CustomResponse.php diff --git a/test/ClientTest.php b/test/ClientTest.php index 4518a0d125..fa622799e8 100644 --- a/test/ClientTest.php +++ b/test/ClientTest.php @@ -350,50 +350,6 @@ public function testAdapterAlwaysReachableIfSpecified() $this->assertSame($testAdapter, $client->getAdapter()); } - /** - * Custom response object is set but still invalid code coming back - * @expectedException Zend\Http\Exception\InvalidArgumentException - */ - public function testUsageOfCustomResponseInvalidCode() - { - require_once(dirname(realpath(__FILE__)) . DIRECTORY_SEPARATOR .'_files' . DIRECTORY_SEPARATOR . 'CustomResponse.php'); - $testAdapter = new Test(); - $testAdapter->setResponse( - "HTTP/1.1 496 CustomResponse\r\n\r\n" - . "Whatever content" - ); - - $client = new Client('http://www.example.org/', array( - 'adapter' => $testAdapter, - )); - $client->setResponse(new CustomResponse()); - $response = $client->send(); - } - - /** - * Custom response object is set with defined status code 497. - * Should not throw an exception. - */ - public function testUsageOfCustomResponseCustomCode() - { - require_once(dirname(realpath(__FILE__)) . DIRECTORY_SEPARATOR .'_files' . DIRECTORY_SEPARATOR . 'CustomResponse.php'); - $testAdapter = new Test(); - $testAdapter->setResponse( - "HTTP/1.1 497 CustomResponse\r\n\r\n" - . "Whatever content" - ); - - $client = new Client('http://www.example.org/', array( - 'adapter' => $testAdapter, - )); - $client->setResponse(new CustomResponse()); - $response = $client->send(); - - $this->assertInstanceOf('ZendTest\Http\CustomResponse', $response); - $this->assertEquals(497, $response->getStatusCode()); - $this->assertEquals('Whatever content', $response->getContent()); - } - public function testPrepareHeadersCreateRightHttpField() { $body = json_encode(array('foofoo'=>'barbar')); diff --git a/test/_files/CustomResponse.php b/test/_files/CustomResponse.php deleted file mode 100644 index b45cbd1297..0000000000 --- a/test/_files/CustomResponse.php +++ /dev/null @@ -1,7 +0,0 @@ -