Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[#5013] Remove custom code response tests #5318

Closed
wants to merge 1 commit into from

2 participants

@Maks3w
Collaborator

Since #5013 custom response codes can be assigned directly without need to extend the class.

@Maks3w Maks3w [#5013] Remove custom code response tests
Since #5013 custom response codes can be assigned directly without need to extend the class.
303b171
@Maks3w
Collaborator
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@weierophinney weierophinney referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-http
@weierophinney weierophinney Merge pull request zendframework/zf2#5318 from Maks3w/hotfix/5013-rem…
…ove-outdated-test

[zendframework/zf2#5013] Remove custom code response tests
92dcb62
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-http
@weierophinney weierophinney Merge branch 'hotfix/5318' 1417bdb
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-http
@weierophinney weierophinney Merge branch 'hotfix/5318' into develop e1f29e3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 22, 2013
  1. @Maks3w

    [#5013] Remove custom code response tests

    Maks3w authored
    Since #5013 custom response codes can be assigned directly without need to extend the class.
This page is out of date. Refresh to see the latest.
View
44 tests/ZendTest/Http/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'));
View
7 tests/ZendTest/Http/_files/CustomResponse.php
@@ -1,7 +0,0 @@
-<?php
-namespace ZendTest\Http;
-
-class CustomResponse extends \Zend\Http\Response
-{
- const STATUS_CODE_497 = 497;
-}
Something went wrong with that request. Please try again.