Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/5318'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Oct 22, 2013
2 parents 02a046c + 92dcb62 commit 1417bdb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
44 changes: 0 additions & 44 deletions test/ClientTest.php
Expand Up @@ -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'));
Expand Down
7 changes: 0 additions & 7 deletions test/_files/CustomResponse.php

This file was deleted.

0 comments on commit 1417bdb

Please sign in to comment.