Permalink
Browse files

fixing indetation problems

  • Loading branch information...
1 parent 3565127 commit a93f3f190a06d06b05c24abfeab207aaf0c60b22 Joseph Crawford committed Dec 7, 2012
Showing with 15 additions and 15 deletions.
  1. +15 −15 tests/ZendTest/Http/ClientTest.php
@@ -25,27 +25,27 @@ public function testClientRetrievesUppercaseHttpMethodFromRequestObject()
$client->setMethod('post');
$this->assertEquals(Client::ENC_URLENCODED, $client->getEncType());
}
-
+
public function testAcceptEncodingHeaderWorksProperly()
{
- $method = new \ReflectionMethod('\Zend\Http\Client', 'prepareHeaders');
- $method->setAccessible(true);
+ $method = new \ReflectionMethod('\Zend\Http\Client', 'prepareHeaders');
+ $method->setAccessible(true);
+
+ $requestString = "GET http://www.domain.com/index.php HTTP/1.1\r\nHost: domain.com\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20100101 Firefox/16.0\r\nAccept: */*\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\n";
+ $request = Request::fromString($requestString);
- $requestString = "GET http://www.domain.com/index.php HTTP/1.1\r\nHost: domain.com\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20100101 Firefox/16.0\r\nAccept: */*\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\n";
- $request = Request::fromString($requestString);
+ $adapter = new \Zend\Http\Client\Adapter\Test();
- $adapter = new \Zend\Http\Client\Adapter\Test();
-
- $client = new \Zend\Http\Client('http://www.domain.com/');
- $client->setAdapter($adapter);
- $client->setRequest($request);
+ $client = new \Zend\Http\Client('http://www.domain.com/');
+ $client->setAdapter($adapter);
+ $client->setRequest($request);
- $rawHeaders = "HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nContent-Encoding: gzip, deflate\r\nContent-Type: application/javascript\r\nDate: Sun, 18 Nov 2012 16:16:08 GMT\r\nServer: nginx/1.1.19\r\nVary: Accept-Encoding\r\nX-Powered-By: PHP/5.3.10-1ubuntu3.4\r\nConnection: keep-alive\r\n";
- $response = Response::fromString($rawHeaders);
- $client->getAdapter()->setResponse($response);
+ $rawHeaders = "HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nContent-Encoding: gzip, deflate\r\nContent-Type: application/javascript\r\nDate: Sun, 18 Nov 2012 16:16:08 GMT\r\nServer: nginx/1.1.19\r\nVary: Accept-Encoding\r\nX-Powered-By: PHP/5.3.10-1ubuntu3.4\r\nConnection: keep-alive\r\n";
+ $response = Response::fromString($rawHeaders);
+ $client->getAdapter()->setResponse($response);
- $headers = $method->invoke($client, $requestString, $client->getUri());
- $this->assertEquals('gzip, deflate', $headers['Accept-Encoding']);
+ $headers = $method->invoke($client, $requestString, $client->getUri());
+ $this->assertEquals('gzip, deflate', $headers['Accept-Encoding']);
}
public function testIfZeroValueCookiesCanBeSet()

0 comments on commit a93f3f1

Please sign in to comment.