From 65e3b0b5cda38326149bfed0f07b2fe66653b29c Mon Sep 17 00:00:00 2001 From: Maks3w Date: Thu, 12 Jul 2012 21:11:36 +0200 Subject: [PATCH] [PSR-2] fixers=braces,elseif,short_tag,php_closing_tag,trailing_spaces,linefeed Applied php-cs-fixer --fixers=braces,elseif,short_tag,php_closing_tag,trailing_spaces,linefeed --- .../Exception/InvalidArgumentException.php | 2 +- .../Adapter/Exception/OutOfRangeException.php | 2 +- .../Adapter/Exception/RuntimeException.php | 2 +- src/Client/Cookies.php | 3 +- .../Exception/InvalidArgumentException.php | 2 +- src/Client/Exception/OutOfRangeException.php | 2 +- src/Client/Exception/RuntimeException.php | 2 +- src/Cookies.php | 3 +- src/Exception/InvalidArgumentException.php | 2 +- src/Exception/OutOfRangeException.php | 2 +- src/Exception/RuntimeException.php | 2 +- src/Header/AbstractAccept.php | 34 +++++++++--------- src/Header/Accept.php | 18 +++++----- src/Header/AcceptCharset.php | 20 +++++------ src/Header/AcceptEncoding.php | 20 +++++------ src/Header/AcceptLanguage.php | 22 ++++++------ src/Header/AcceptRanges.php | 2 +- src/Header/Cookie.php | 4 +-- src/Header/Exception/ExceptionInterface.php | 2 +- .../Exception/InvalidArgumentException.php | 2 +- src/Header/Exception/RuntimeException.php | 2 +- src/Header/GenericHeader.php | 8 ++--- src/Header/SetCookie.php | 36 +++++++++---------- test/Client/StaticClientTest.php | 10 +++--- test/Client/StaticTest.php | 22 ++++++------ test/Header/AcceptCharsetTest.php | 8 ++--- test/Header/AcceptEncodingTest.php | 8 ++--- test/Header/AcceptLanguageTest.php | 8 ++--- test/Header/AcceptRangesTest.php | 2 +- test/Header/AcceptTest.php | 12 +++---- test/Header/AuthenticationInfoTest.php | 2 +- test/Header/AuthorizationTest.php | 2 +- test/Header/ConnectionTest.php | 2 +- test/Header/ContentDispositionTest.php | 2 +- test/Header/ContentEncodingTest.php | 2 +- test/Header/ContentLanguageTest.php | 2 +- test/Header/ContentLengthTest.php | 2 +- test/Header/ContentMD5Test.php | 2 +- test/Header/ContentRangeTest.php | 2 +- test/Header/ContentTypeTest.php | 2 +- test/Header/EtagTest.php | 2 +- test/Header/ExpectTest.php | 2 +- test/Header/ExpiresTest.php | 2 +- test/Header/FromTest.php | 2 +- test/Header/HostTest.php | 2 +- test/Header/IfMatchTest.php | 2 +- test/Header/IfModifiedSinceTest.php | 2 +- test/Header/IfNoneMatchTest.php | 2 +- test/Header/IfRangeTest.php | 2 +- test/Header/IfUnmodifiedSinceTest.php | 2 +- test/Header/KeepAliveTest.php | 2 +- test/Header/LastModifiedTest.php | 2 +- test/Header/MaxForwardsTest.php | 2 +- test/Header/PragmaTest.php | 2 +- test/Header/ProxyAuthenticateTest.php | 2 +- test/Header/ProxyAuthorizationTest.php | 2 +- test/Header/RangeTest.php | 2 +- test/Header/RefreshTest.php | 2 +- test/Header/ServerTest.php | 2 +- test/Header/SetCookieTest.php | 12 +++---- test/Header/TETest.php | 2 +- test/Header/TrailerTest.php | 2 +- test/Header/TransferEncodingTest.php | 2 +- test/Header/UpgradeTest.php | 2 +- test/Header/UserAgentTest.php | 2 +- test/Header/VaryTest.php | 2 +- test/Header/ViaTest.php | 2 +- test/Header/WWWAuthenticateTest.php | 2 +- test/Header/WarningTest.php | 2 +- 69 files changed, 177 insertions(+), 175 deletions(-) diff --git a/src/Client/Adapter/Exception/InvalidArgumentException.php b/src/Client/Adapter/Exception/InvalidArgumentException.php index 4722f21a92..f88d275c54 100644 --- a/src/Client/Adapter/Exception/InvalidArgumentException.php +++ b/src/Client/Adapter/Exception/InvalidArgumentException.php @@ -17,6 +17,6 @@ * @category Zend * @package Zend_Application */ -class InvalidArgumentException extends Exception\InvalidArgumentException implements +class InvalidArgumentException extends Exception\InvalidArgumentException implements ExceptionInterface {} diff --git a/src/Client/Adapter/Exception/OutOfRangeException.php b/src/Client/Adapter/Exception/OutOfRangeException.php index 579395a664..efc24c15c6 100644 --- a/src/Client/Adapter/Exception/OutOfRangeException.php +++ b/src/Client/Adapter/Exception/OutOfRangeException.php @@ -17,6 +17,6 @@ * @category Zend * @package Zend_Application */ -class OutOfRangeException extends Exception\OutOfRangeException implements +class OutOfRangeException extends Exception\OutOfRangeException implements ExceptionInterface {} diff --git a/src/Client/Adapter/Exception/RuntimeException.php b/src/Client/Adapter/Exception/RuntimeException.php index bf40e754e1..2c7354b12c 100644 --- a/src/Client/Adapter/Exception/RuntimeException.php +++ b/src/Client/Adapter/Exception/RuntimeException.php @@ -17,6 +17,6 @@ * @category Zend * @package Zend_Application */ -class RuntimeException extends Exception\RuntimeException implements +class RuntimeException extends Exception\RuntimeException implements ExceptionInterface {} diff --git a/src/Client/Cookies.php b/src/Client/Cookies.php index e644b18d92..cad1e7fd93 100644 --- a/src/Client/Cookies.php +++ b/src/Client/Cookies.php @@ -248,7 +248,8 @@ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT) * @param int $ret_as What value to return * @return array|string */ - protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT) { + protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT) + { if (is_array($ptr)) { $ret = ($ret_as == self::COOKIE_STRING_CONCAT ? '' : array()); foreach ($ptr as $item) { diff --git a/src/Client/Exception/InvalidArgumentException.php b/src/Client/Exception/InvalidArgumentException.php index 623c078a48..7bf8dc4599 100644 --- a/src/Client/Exception/InvalidArgumentException.php +++ b/src/Client/Exception/InvalidArgumentException.php @@ -17,6 +17,6 @@ * @category Zend * @package Zend_Application */ -class InvalidArgumentException extends Exception\InvalidArgumentException implements +class InvalidArgumentException extends Exception\InvalidArgumentException implements ExceptionInterface {} diff --git a/src/Client/Exception/OutOfRangeException.php b/src/Client/Exception/OutOfRangeException.php index 2991567597..2617ca7cce 100644 --- a/src/Client/Exception/OutOfRangeException.php +++ b/src/Client/Exception/OutOfRangeException.php @@ -12,6 +12,6 @@ use Zend\Http\Exception; -class OutOfRangeException extends Exception\OutOfRangeException implements +class OutOfRangeException extends Exception\OutOfRangeException implements ExceptionInterface {} diff --git a/src/Client/Exception/RuntimeException.php b/src/Client/Exception/RuntimeException.php index 3db2c3c6a6..8b0a37bf40 100644 --- a/src/Client/Exception/RuntimeException.php +++ b/src/Client/Exception/RuntimeException.php @@ -17,6 +17,6 @@ * @category Zend * @package Zend_Application */ -class RuntimeException extends Exception\RuntimeException implements +class RuntimeException extends Exception\RuntimeException implements ExceptionInterface {} diff --git a/src/Cookies.php b/src/Cookies.php index 47115a57bf..9ab3c358be 100644 --- a/src/Cookies.php +++ b/src/Cookies.php @@ -220,7 +220,8 @@ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT) * @param int $ret_as What value to return * @return array|string */ - protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT) { + protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT) + { if (is_array($ptr)) { $ret = ($ret_as == self::COOKIE_STRING_CONCAT ? '' : array()); foreach ($ptr as $item) { diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index 0ec9a77758..33a10f68de 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -10,7 +10,7 @@ namespace Zend\Http\Exception; -class InvalidArgumentException extends \InvalidArgumentException implements +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface { } diff --git a/src/Exception/OutOfRangeException.php b/src/Exception/OutOfRangeException.php index 95ec26d700..0c49a2261d 100644 --- a/src/Exception/OutOfRangeException.php +++ b/src/Exception/OutOfRangeException.php @@ -10,6 +10,6 @@ namespace Zend\Http\Exception; -class OutOfRangeException extends \OutOfRangeException implements +class OutOfRangeException extends \OutOfRangeException implements ExceptionInterface {} diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php index 2c2e74d024..c63b338da4 100644 --- a/src/Exception/RuntimeException.php +++ b/src/Exception/RuntimeException.php @@ -10,7 +10,7 @@ namespace Zend\Http\Exception; -class RuntimeException extends \RuntimeException implements +class RuntimeException extends \RuntimeException implements ExceptionInterface { } diff --git a/src/Header/AbstractAccept.php b/src/Header/AbstractAccept.php index 11a4abeec7..90e7fedfbf 100644 --- a/src/Header/AbstractAccept.php +++ b/src/Header/AbstractAccept.php @@ -27,12 +27,12 @@ abstract class AbstractAccept implements HeaderInterface protected $priorityQueue; protected $types = array(); - protected $regexAddType; - + protected $regexAddType; + /** * Factory method: parse Accept header string - * - * @param string $headerLine + * + * @param string $headerLine * @return Accept */ public static function fromString($headerLine) @@ -87,7 +87,7 @@ public static function fromString($headerLine) /** * Get field value - * + * * @return string */ public function getFieldValue() @@ -101,10 +101,10 @@ public function getFieldValue() /** * Add a type, with the given priority - * - * @param string $type - * @param int|float $priority - * @param int $level + * + * @param string $type + * @param int|float $priority + * @param int $level * @return Accept */ protected function addType($type, $priority = 1, $level = null) @@ -140,7 +140,7 @@ protected function addType($type, $priority = 1, $level = null) $level )); } - + $this->types[$type] = true; if (!empty($level)) { @@ -155,7 +155,7 @@ protected function addType($type, $priority = 1, $level = null) 'priority' => $priority ); } - + $value = $type; if (!empty($level)) { $value .= sprintf(';level=%d', $level); @@ -170,8 +170,8 @@ protected function addType($type, $priority = 1, $level = null) /** * Does the header have the requested type? - * - * @param string $type + * + * @param string $type * @return bool */ protected function hasType($type) @@ -184,7 +184,7 @@ protected function hasType($type) } // Check for media type - if (false !== strstr($type, '/')) { + if (false !== strstr($type, '/')) { // Parent type wildcard matching $parent = substr($type, 0, strpos($type, '/')); if (isset($this->types[$parent . '/*'])) { @@ -206,7 +206,7 @@ protected function hasType($type) /** * Get a prioritized list of types - * + * * @return PriorityQueue */ public function getPrioritized() @@ -220,7 +220,7 @@ public function getPrioritized() /** * Create the priority queue - * + * * @return void */ protected function createPriorityQueue() @@ -232,7 +232,7 @@ protected function createPriorityQueue() continue; } - // Hack to ensure priorities are correct; was not treating + // Hack to ensure priorities are correct; was not treating // fractional values correctly $suffix = ''; $level = 0; diff --git a/src/Header/Accept.php b/src/Header/Accept.php index c39a35f774..6c0edf9b18 100644 --- a/src/Header/Accept.php +++ b/src/Header/Accept.php @@ -20,10 +20,10 @@ class Accept extends AbstractAccept { protected $regexAddType = '#^([a-zA-Z+-]+|\*)/(\*|[a-zA-Z0-9+-]+)$#'; - + /** * Get field name - * + * * @return string */ public function getFieldName() @@ -33,7 +33,7 @@ public function getFieldName() /** * Cast to string - * + * * @return string */ public function toString() @@ -43,10 +43,10 @@ public function toString() /** * Add a media type, with the given priority - * - * @param string $type - * @param int|float $priority - * @param int $level + * + * @param string $type + * @param int|float $priority + * @param int $level * @return Accept */ public function addMediaType($type, $priority = 1, $level = null) @@ -56,8 +56,8 @@ public function addMediaType($type, $priority = 1, $level = null) /** * Does the header have the requested media type? - * - * @param string $type + * + * @param string $type * @return bool */ public function hasMediaType($type) diff --git a/src/Header/AcceptCharset.php b/src/Header/AcceptCharset.php index 8229825d5b..913462e3a8 100644 --- a/src/Header/AcceptCharset.php +++ b/src/Header/AcceptCharset.php @@ -20,10 +20,10 @@ class AcceptCharset extends AbstractAccept { protected $regexAddType = '#^([a-zA-Z0-9+-]+|\*)$#'; - + /** * Get field name - * + * * @return string */ public function getFieldName() @@ -33,30 +33,30 @@ public function getFieldName() /** * Cast to string - * + * * @return string */ public function toString() { return 'Accept-Charset: ' . $this->getFieldValue(); } - + /** * Add a charset, with the given priority - * - * @param string $type - * @param int|float $priority + * + * @param string $type + * @param int|float $priority * @return Accept */ public function addCharset($type, $priority = 1) { return $this->addType($type, $priority); } - + /** * Does the header have the requested charset? - * - * @param string $type + * + * @param string $type * @return bool */ public function hasCharset($type) diff --git a/src/Header/AcceptEncoding.php b/src/Header/AcceptEncoding.php index 2e46cdeb69..7c898bf1b7 100644 --- a/src/Header/AcceptEncoding.php +++ b/src/Header/AcceptEncoding.php @@ -21,10 +21,10 @@ class AcceptEncoding extends AbstractAccept { protected $regexAddType = '#^([a-zA-Z0-9+-]+|\*)$#'; - + /** * Get field name - * + * * @return string */ public function getFieldName() @@ -34,30 +34,30 @@ public function getFieldName() /** * Cast to string - * + * * @return string */ public function toString() { return 'Accept-Encoding: ' . $this->getFieldValue(); } - + /** * Add an encoding, with the given priority - * - * @param string $type - * @param int|float $priority + * + * @param string $type + * @param int|float $priority * @return Accept */ public function addEncoding($type, $priority = 1) { return $this->addType($type, $priority); } - + /** * Does the header have the requested encoding? - * - * @param string $type + * + * @param string $type * @return bool */ public function hasEncoding($type) diff --git a/src/Header/AcceptLanguage.php b/src/Header/AcceptLanguage.php index 23efa54cc2..c63d1ccbac 100644 --- a/src/Header/AcceptLanguage.php +++ b/src/Header/AcceptLanguage.php @@ -21,10 +21,10 @@ class AcceptLanguage extends AbstractAccept { protected $regexAddType = '#^([a-zA-Z0-9+-]+|\*)$#'; - + /** * Get field name - * + * * @return string */ public function getFieldName() @@ -34,35 +34,35 @@ public function getFieldName() /** * Cast to string - * + * * @return string */ public function toString() { return 'Accept-Language: ' . $this->getFieldValue(); } - + /** * Add a language, with the given priority - * - * @param string $type - * @param int|float $priority + * + * @param string $type + * @param int|float $priority * @return Accept */ public function addLanguage($type, $priority = 1) { return $this->addType($type, $priority); } - + /** * Does the header have the requested language? - * - * @param string $type + * + * @param string $type * @return bool */ public function hasLanguage($type) { return $this->hasType($type); } - + } diff --git a/src/Header/AcceptRanges.php b/src/Header/AcceptRanges.php index bb207785ea..b002392dd9 100644 --- a/src/Header/AcceptRanges.php +++ b/src/Header/AcceptRanges.php @@ -63,5 +63,5 @@ public function toString() { return 'Accept-Ranges: ' . $this->getFieldValue(); } - + } diff --git a/src/Header/Cookie.php b/src/Header/Cookie.php index fef706d025..4125adb8aa 100644 --- a/src/Header/Cookie.php +++ b/src/Header/Cookie.php @@ -63,7 +63,7 @@ public static function fromString($headerLine) } $header->exchangeArray($arrayInfo); - + return $header; } @@ -98,7 +98,7 @@ public function getFieldValue() return implode('; ', $nvPairs); } - + public function toString() { return 'Cookie: ' . $this->getFieldValue(); diff --git a/src/Header/Exception/ExceptionInterface.php b/src/Header/Exception/ExceptionInterface.php index f7602faa0c..34c0a15201 100644 --- a/src/Header/Exception/ExceptionInterface.php +++ b/src/Header/Exception/ExceptionInterface.php @@ -12,5 +12,5 @@ use Zend\Http\Exception\ExceptionInterface as HttpException; -interface ExceptionInterface extends HttpException +interface ExceptionInterface extends HttpException {} diff --git a/src/Header/Exception/InvalidArgumentException.php b/src/Header/Exception/InvalidArgumentException.php index f062ac05f2..5bbd6e4a8b 100644 --- a/src/Header/Exception/InvalidArgumentException.php +++ b/src/Header/Exception/InvalidArgumentException.php @@ -12,7 +12,7 @@ use Zend\Http\Exception; -class InvalidArgumentException extends Exception\InvalidArgumentException implements +class InvalidArgumentException extends Exception\InvalidArgumentException implements ExceptionInterface { } diff --git a/src/Header/Exception/RuntimeException.php b/src/Header/Exception/RuntimeException.php index d767b12beb..62d47221d4 100644 --- a/src/Header/Exception/RuntimeException.php +++ b/src/Header/Exception/RuntimeException.php @@ -12,7 +12,7 @@ use Zend\Http\Exception; -class RuntimeException extends Exception\RuntimeException implements +class RuntimeException extends Exception\RuntimeException implements ExceptionInterface { } diff --git a/src/Header/GenericHeader.php b/src/Header/GenericHeader.php index 33a12082d5..82007ecb0b 100644 --- a/src/Header/GenericHeader.php +++ b/src/Header/GenericHeader.php @@ -45,7 +45,7 @@ public static function fromString($headerLine) /** * Constructor - * + * * @param null|string $fieldName * @param null|string $fieldValue */ @@ -62,7 +62,7 @@ public function __construct($fieldName = null, $fieldValue = null) /** * Set header field name - * + * * @param string $fieldName * @return GenericHeader * @throws Exception\InvalidArgumentException( @@ -99,7 +99,7 @@ public function getFieldName() /** * Set header field value - * + * * @param string $fieldValue * @return GenericHeader */ @@ -117,7 +117,7 @@ public function setFieldValue($fieldValue) /** * Retrieve header field value - * + * * @return string */ public function getFieldValue() diff --git a/src/Header/SetCookie.php b/src/Header/SetCookie.php index 70baf45263..fc63004474 100644 --- a/src/Header/SetCookie.php +++ b/src/Header/SetCookie.php @@ -34,18 +34,18 @@ class SetCookie implements MultipleHeaderInterface /** * Version - * + * * @var integer */ protected $version = null; - + /** * Max Age - * + * * @var integer */ protected $maxAge = null; - + /** * Cookie expiry date * @@ -121,7 +121,7 @@ public static function fromString($headerLine, $bypassHeaderFieldName = false) case 'version' : $header->setVersion((int) $headerValue); break; case 'maxage' : $header->setMaxAge((int) $headerValue); break; default: - // Intentionally omitted + // Intentionally omitted } } @@ -180,11 +180,11 @@ public function __construct($name = null, $value = null, $expires = null, $path if ($version!==null) { $this->setVersion($version); } - + if ($maxAge!==null) { $this->setMaxAge($maxAge); } - + if ($domain) { $this->setDomain($domain); } @@ -223,7 +223,7 @@ public function getFieldValue() if ($this->getName() == '') { throw new Exception\RuntimeException('A cookie name is required to generate a field value for this cookie'); } - + $value = $this->getValue(); if (strpos($value, '"')!==false) { $value = '"'.urlencode(str_replace('"', '', $value)).'"'; @@ -236,12 +236,12 @@ public function getFieldValue() if ($version!==null) { $fieldValue .= '; Version=' . $version; } - + $maxAge = $this->getMaxAge(); if ($maxAge!==null) { $fieldValue .= '; Max-Age=' . $maxAge; } - + $expires = $this->getExpires(); if ($expires) { $fieldValue .= '; Expires=' . $expires; @@ -308,7 +308,7 @@ public function getValue() /** * Set version - * + * * @param integer $version */ public function setVersion($version) @@ -318,20 +318,20 @@ public function setVersion($version) } $this->version = $version; } - + /** * Get version - * + * * @return integer */ public function getVersion() { return $this->version; } - + /** * Set Max-Age - * + * * @param integer $maxAge */ public function setMaxAge($maxAge) @@ -341,17 +341,17 @@ public function setMaxAge($maxAge) } $this->maxAge = $maxAge; } - + /** * Get Max-Age - * + * * @return integer */ public function getMaxAge() { return $this->maxAge; } - + /** * @param int $expires * @return SetCookie diff --git a/test/Client/StaticClientTest.php b/test/Client/StaticClientTest.php index 0fa7b5d3c9..9dfa6ba2ec 100644 --- a/test/Client/StaticClientTest.php +++ b/test/Client/StaticClientTest.php @@ -49,7 +49,7 @@ protected function setUp() $this->markTestSkipped("Zend_Http_Client dynamic tests are not enabled in TestConfiguration.php"); } } - + /** * Test simple GET */ @@ -58,7 +58,7 @@ public function testHttpSimpleGet() $response= HTTPClient::get($this->baseuri . 'testSimpleRequests.php'); $this->assertTrue($response->isSuccess()); } - + /** * Test GET with query string in URI */ @@ -68,7 +68,7 @@ public function testHttpGetWithParamsInUri() $this->assertTrue($response->isSuccess()); $this->assertContains('foo',$response->getBody()); } - + /** * Test GET with query as params */ @@ -79,7 +79,7 @@ public function testHttpMultiGetWithParam() $this->assertContains('foo',$response->getBody()); $this->assertContains('bar',$response->getBody()); } - + /** * Test simple POST */ @@ -90,7 +90,7 @@ public function testHttpSimplePost() $this->assertContains('foo',$response->getBody()); $this->assertContains('bar',$response->getBody()); } - + /** * Test POST with header Content-Type */ diff --git a/test/Client/StaticTest.php b/test/Client/StaticTest.php index 59cff5c40a..84cec2a144 100644 --- a/test/Client/StaticTest.php +++ b/test/Client/StaticTest.php @@ -129,7 +129,7 @@ public function testGetHeader() $this->assertEquals($this->_client->getHeader('Accept-encoding'), 'gzip,deflate', 'Returned value of header is not as expected'); $this->assertEquals($this->_client->getHeader('X-Fake-Header'), null, 'Non-existing header should not return a value'); } - + /** * Authentication tests */ @@ -181,7 +181,7 @@ public function testUnsetCookies() // Try unsetting the cookies $this->_client->clearCookies(); $cookies = $this->_client->getCookies(); - + $this->assertTrue(empty($cookies), 'Cookies is expected to be null but it is not'); } @@ -208,7 +208,7 @@ public function testSetInvalidCookies() */ public function testConfigSetAsArray() { - + $config = array( 'timeout' => 500, 'someoption' => 'hasvalue' @@ -230,7 +230,7 @@ public function testConfigSetAsArray() */ public function testConfigSetAsZendConfig() { - + $config = new \Zend\Config\Config(array( 'timeout' => 400, 'nested' => array( @@ -267,7 +267,7 @@ public function testConfigSetInvalid($config) */ public function testConfigPassToAdapterZF4557() { - + $adapter = new MockAdapter(); // test that config passes when we set the adapter @@ -410,9 +410,9 @@ public function testFormDataEncodingWithMultiArrayZF7038() $this->_client->send(); $expectedLines = file(__DIR__ . '/_files/ZF7038-multipartarrayrequest.txt'); - + $gotLines = explode("\n", $this->_client->getLastRawRequest()); - + $this->assertEquals(count($expectedLines), count($gotLines)); while (($expected = array_shift($expectedLines)) && @@ -455,10 +455,10 @@ public function testMultibyteRawPostDataZF2098() $this->assertEquals(filesize($bodyFile), (int) $match[1]); } - + /** * Testing if the connection isn't closed - * + * * @group ZF-9685 */ public function testOpenTempStreamWithValidFileDoesntThrowsException() @@ -478,10 +478,10 @@ public function testOpenTempStreamWithValidFileDoesntThrowsException() // @todo verify link is still active return; } - + /** * Testing if the connection can be closed - * + * * @group ZF-9685 */ public function testOpenTempStreamWithBogusFileClosesTheConnection() diff --git a/test/Header/AcceptCharsetTest.php b/test/Header/AcceptCharsetTest.php index 591884b076..ef10e3e1d8 100644 --- a/test/Header/AcceptCharsetTest.php +++ b/test/Header/AcceptCharsetTest.php @@ -40,12 +40,12 @@ public function testAcceptCharsetToStringReturnsHeaderFormattedString() $acceptCharsetHeader = new AcceptCharset(); $acceptCharsetHeader->addCharset('iso-8859-5', 0.8) ->addCharset('unicode-1-1', 1); - + $this->assertEquals('Accept-Charset: iso-8859-5;q=0.8,unicode-1-1', $acceptCharsetHeader->toString()); } /** Implmentation specific tests here */ - + public function testCanParseCommaSeparatedValues() { $header = AcceptCharset::fromString('Accept-Charset: iso-8859-5;q=0.8,unicode-1-1'); @@ -68,13 +68,13 @@ public function testPrioritizesValuesBasedOnQParameter() } $this->assertEquals($expected, $test); } - + public function testWildcharCharset() { $acceptHeader = new AcceptCharset(); $acceptHeader->addCharset('iso-8859-5', 0.8) ->addCharset('*', 0.4); - + $this->assertTrue($acceptHeader->hasCharset('iso-8859-5')); $this->assertTrue($acceptHeader->hasCharset('unicode-1-1')); $this->assertEquals('Accept-Charset: iso-8859-5;q=0.8,*;q=0.4', $acceptHeader->toString()); diff --git a/test/Header/AcceptEncodingTest.php b/test/Header/AcceptEncodingTest.php index 096d4022da..7a2de03266 100644 --- a/test/Header/AcceptEncodingTest.php +++ b/test/Header/AcceptEncodingTest.php @@ -40,12 +40,12 @@ public function testAcceptEncodingToStringReturnsHeaderFormattedString() $acceptEncodingHeader = new AcceptEncoding(); $acceptEncodingHeader->addEncoding('compress', 0.5) ->addEncoding('gzip', 1); - + $this->assertEquals('Accept-Encoding: compress;q=0.5,gzip', $acceptEncodingHeader->toString()); } /** Implmentation specific tests here */ - + public function testCanParseCommaSeparatedValues() { $header = AcceptEncoding::fromString('Accept-Encoding: compress;q=0.5,gzip'); @@ -68,13 +68,13 @@ public function testPrioritizesValuesBasedOnQParameter() } $this->assertEquals($expected, $test); } - + public function testWildcharEncoder() { $acceptHeader = new AcceptEncoding(); $acceptHeader->addEncoding('compress', 0.8) ->addEncoding('*', 0.4); - + $this->assertTrue($acceptHeader->hasEncoding('compress')); $this->assertTrue($acceptHeader->hasEncoding('gzip')); $this->assertEquals('Accept-Encoding: compress;q=0.8,*;q=0.4', $acceptHeader->toString()); diff --git a/test/Header/AcceptLanguageTest.php b/test/Header/AcceptLanguageTest.php index 20f31a6a6c..b9c40a5865 100644 --- a/test/Header/AcceptLanguageTest.php +++ b/test/Header/AcceptLanguageTest.php @@ -39,12 +39,12 @@ public function testAcceptLanguageToStringReturnsHeaderFormattedString() $acceptLanguageHeader = new AcceptLanguage(); $acceptLanguageHeader->addLanguage('da', 0.8) ->addLanguage('en-gb', 1); - + $this->assertEquals('Accept-Language: da;q=0.8,en-gb', $acceptLanguageHeader->toString()); } /** Implmentation specific tests here */ - + public function testCanParseCommaSeparatedValues() { $header = AcceptLanguage::fromString('Accept-Language: da;q=0.8,en-gb'); @@ -67,13 +67,13 @@ public function testPrioritizesValuesBasedOnQParameter() } $this->assertEquals($expected, $test); } - + public function testWildcharLanguage() { $acceptHeader = new AcceptLanguage(); $acceptHeader->addLanguage('da', 0.8) ->addLanguage('*', 0.4); - + $this->assertTrue($acceptHeader->hasLanguage('da')); $this->assertTrue($acceptHeader->hasLanguage('en')); $this->assertEquals('Accept-Language: da;q=0.8,*;q=0.4', $acceptHeader->toString()); diff --git a/test/Header/AcceptRangesTest.php b/test/Header/AcceptRangesTest.php index e7d08603e0..8c4462a33b 100644 --- a/test/Header/AcceptRangesTest.php +++ b/test/Header/AcceptRangesTest.php @@ -45,6 +45,6 @@ public function testAcceptRangesToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/AcceptTest.php b/test/Header/AcceptTest.php index 96bbf388f7..99989e663d 100644 --- a/test/Header/AcceptTest.php +++ b/test/Header/AcceptTest.php @@ -73,7 +73,7 @@ public function testPrioritizesValuesBasedOnQParameter() } $this->assertEquals($expected, $test); } - + public function testLevel() { $acceptHeader = new Accept(); @@ -83,11 +83,11 @@ public function testLevel() $this->assertEquals('Accept: text/html;level=1;q=0.8,text/html;level=2;q=0.4,application/atom+xml;q=0.9', $acceptHeader->toString()); } - + public function testPrioritizedLevel() { $header = Accept::fromString('Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,text/html;level=2;q=0.4, */*;q=0.5'); - + $expected = array ( 'text/html;level=1', 'text/html', @@ -95,21 +95,21 @@ public function testPrioritizedLevel() 'text/html;level=2', 'text/*' ); - + $test = array(); foreach($header->getPrioritized() as $type) { $test[] = $type; } $this->assertEquals($expected, $test); } - + public function testWildcharMediaType() { $acceptHeader = new Accept(); $acceptHeader->addMediaType('text/*', 0.8) ->addMediaType('application/*', 1) ->addMediaType('*/*', 0.4); - + $this->assertTrue($acceptHeader->hasMediaType('text/html')); $this->assertTrue($acceptHeader->hasMediaType('application/atom+xml')); $this->assertTrue($acceptHeader->hasMediaType('audio/basic')); diff --git a/test/Header/AuthenticationInfoTest.php b/test/Header/AuthenticationInfoTest.php index 7c7bc4fab5..eea0fb98ac 100644 --- a/test/Header/AuthenticationInfoTest.php +++ b/test/Header/AuthenticationInfoTest.php @@ -47,6 +47,6 @@ public function testAuthenticationInfoToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/AuthorizationTest.php b/test/Header/AuthorizationTest.php index 8eed11638b..a8b3f7b477 100644 --- a/test/Header/AuthorizationTest.php +++ b/test/Header/AuthorizationTest.php @@ -47,6 +47,6 @@ public function testAuthorizationToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ConnectionTest.php b/test/Header/ConnectionTest.php index df070cf962..f1c6ecb527 100644 --- a/test/Header/ConnectionTest.php +++ b/test/Header/ConnectionTest.php @@ -54,6 +54,6 @@ public function testConnectionSetPersistentReturnsProperValue() $this->assertEquals('close', $connectionHeader->getFieldValue()); } - + } diff --git a/test/Header/ContentDispositionTest.php b/test/Header/ContentDispositionTest.php index 3e316dbff5..9f8a493db8 100644 --- a/test/Header/ContentDispositionTest.php +++ b/test/Header/ContentDispositionTest.php @@ -47,6 +47,6 @@ public function testContentDispositionToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ContentEncodingTest.php b/test/Header/ContentEncodingTest.php index 67b47f46f8..d52dbc72b2 100644 --- a/test/Header/ContentEncodingTest.php +++ b/test/Header/ContentEncodingTest.php @@ -47,6 +47,6 @@ public function testContentEncodingToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ContentLanguageTest.php b/test/Header/ContentLanguageTest.php index 99af5937de..a00d9e15b6 100644 --- a/test/Header/ContentLanguageTest.php +++ b/test/Header/ContentLanguageTest.php @@ -47,6 +47,6 @@ public function testContentLanguageToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ContentLengthTest.php b/test/Header/ContentLengthTest.php index 9c62c1ffca..feacf47ed8 100644 --- a/test/Header/ContentLengthTest.php +++ b/test/Header/ContentLengthTest.php @@ -47,6 +47,6 @@ public function testContentLengthToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ContentMD5Test.php b/test/Header/ContentMD5Test.php index 0632c08a2e..c451990b45 100644 --- a/test/Header/ContentMD5Test.php +++ b/test/Header/ContentMD5Test.php @@ -47,6 +47,6 @@ public function testContentMD5ToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ContentRangeTest.php b/test/Header/ContentRangeTest.php index ca6862f795..c99714249a 100644 --- a/test/Header/ContentRangeTest.php +++ b/test/Header/ContentRangeTest.php @@ -47,6 +47,6 @@ public function testContentRangeToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ContentTypeTest.php b/test/Header/ContentTypeTest.php index c1779b83fe..9d9c06f7c2 100644 --- a/test/Header/ContentTypeTest.php +++ b/test/Header/ContentTypeTest.php @@ -47,6 +47,6 @@ public function testContentTypeToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/EtagTest.php b/test/Header/EtagTest.php index fab0b3b9d6..d595679232 100644 --- a/test/Header/EtagTest.php +++ b/test/Header/EtagTest.php @@ -47,6 +47,6 @@ public function testEtagToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ExpectTest.php b/test/Header/ExpectTest.php index 3abb3148d0..00de719ab4 100644 --- a/test/Header/ExpectTest.php +++ b/test/Header/ExpectTest.php @@ -47,6 +47,6 @@ public function testExpectToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ExpiresTest.php b/test/Header/ExpiresTest.php index a863c3f473..d15e20ae47 100644 --- a/test/Header/ExpiresTest.php +++ b/test/Header/ExpiresTest.php @@ -45,6 +45,6 @@ public function testExpiresToStringReturnsHeaderFormattedString() * Implementation specific tests are covered by DateTest * @see ZendTest\Http\Header\DateTest */ - + } diff --git a/test/Header/FromTest.php b/test/Header/FromTest.php index 84bd899c78..d54deaed39 100644 --- a/test/Header/FromTest.php +++ b/test/Header/FromTest.php @@ -47,6 +47,6 @@ public function testFromToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/HostTest.php b/test/Header/HostTest.php index 1def7c0d07..d02a9ccec5 100644 --- a/test/Header/HostTest.php +++ b/test/Header/HostTest.php @@ -47,6 +47,6 @@ public function testHostToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/IfMatchTest.php b/test/Header/IfMatchTest.php index 5867d00aa7..110fc0d60d 100644 --- a/test/Header/IfMatchTest.php +++ b/test/Header/IfMatchTest.php @@ -47,6 +47,6 @@ public function testIfMatchToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/IfModifiedSinceTest.php b/test/Header/IfModifiedSinceTest.php index ee09a2facd..b4d5be47c2 100644 --- a/test/Header/IfModifiedSinceTest.php +++ b/test/Header/IfModifiedSinceTest.php @@ -46,6 +46,6 @@ public function testIfModifiedSinceToStringReturnsHeaderFormattedString() * Implementation specific tests are covered by DateTest * @see ZendTest\Http\Header\DateTest */ - + } diff --git a/test/Header/IfNoneMatchTest.php b/test/Header/IfNoneMatchTest.php index 03d4800852..5db5ec6766 100644 --- a/test/Header/IfNoneMatchTest.php +++ b/test/Header/IfNoneMatchTest.php @@ -47,6 +47,6 @@ public function testIfNoneMatchToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/IfRangeTest.php b/test/Header/IfRangeTest.php index 07d4083723..8a59722d7f 100644 --- a/test/Header/IfRangeTest.php +++ b/test/Header/IfRangeTest.php @@ -47,6 +47,6 @@ public function testIfRangeToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/IfUnmodifiedSinceTest.php b/test/Header/IfUnmodifiedSinceTest.php index 03b4d902b4..35bb49152c 100644 --- a/test/Header/IfUnmodifiedSinceTest.php +++ b/test/Header/IfUnmodifiedSinceTest.php @@ -46,6 +46,6 @@ public function testIfUnmodifiedSinceToStringReturnsHeaderFormattedString() * Implementation specific tests are covered by DateTest * @see ZendTest\Http\Header\DateTest */ - + } diff --git a/test/Header/KeepAliveTest.php b/test/Header/KeepAliveTest.php index 3dd5d9f020..5bf1ee5633 100644 --- a/test/Header/KeepAliveTest.php +++ b/test/Header/KeepAliveTest.php @@ -47,6 +47,6 @@ public function testKeepAliveToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/LastModifiedTest.php b/test/Header/LastModifiedTest.php index 573489cb85..c526315b95 100644 --- a/test/Header/LastModifiedTest.php +++ b/test/Header/LastModifiedTest.php @@ -46,6 +46,6 @@ public function testLastModifiedToStringReturnsHeaderFormattedString() * Implementation specific tests are covered by DateTest * @see ZendTest\Http\Header\DateTest */ - + } diff --git a/test/Header/MaxForwardsTest.php b/test/Header/MaxForwardsTest.php index 22043f6bf7..9b143a55ff 100644 --- a/test/Header/MaxForwardsTest.php +++ b/test/Header/MaxForwardsTest.php @@ -47,6 +47,6 @@ public function testMaxForwardsToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/PragmaTest.php b/test/Header/PragmaTest.php index 974c179ffa..cf65b32360 100644 --- a/test/Header/PragmaTest.php +++ b/test/Header/PragmaTest.php @@ -47,6 +47,6 @@ public function testPragmaToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ProxyAuthenticateTest.php b/test/Header/ProxyAuthenticateTest.php index bb7915797b..eef06071fe 100644 --- a/test/Header/ProxyAuthenticateTest.php +++ b/test/Header/ProxyAuthenticateTest.php @@ -47,6 +47,6 @@ public function testProxyAuthenticateToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ProxyAuthorizationTest.php b/test/Header/ProxyAuthorizationTest.php index 9287ac5f9c..fe71b2a300 100644 --- a/test/Header/ProxyAuthorizationTest.php +++ b/test/Header/ProxyAuthorizationTest.php @@ -47,6 +47,6 @@ public function testProxyAuthorizationToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/RangeTest.php b/test/Header/RangeTest.php index cdb25c6eac..1a23eba22f 100644 --- a/test/Header/RangeTest.php +++ b/test/Header/RangeTest.php @@ -47,6 +47,6 @@ public function testRangeToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/RefreshTest.php b/test/Header/RefreshTest.php index b105f03e5a..4b0f5d9d6d 100644 --- a/test/Header/RefreshTest.php +++ b/test/Header/RefreshTest.php @@ -47,6 +47,6 @@ public function testRefreshToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ServerTest.php b/test/Header/ServerTest.php index 2e4cef3d8e..976917634f 100644 --- a/test/Header/ServerTest.php +++ b/test/Header/ServerTest.php @@ -47,6 +47,6 @@ public function testServerToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/SetCookieTest.php b/test/Header/SetCookieTest.php index e388bd7a56..701961beda 100644 --- a/test/Header/SetCookieTest.php +++ b/test/Header/SetCookieTest.php @@ -20,7 +20,7 @@ class SetCookieTest extends \PHPUnit_Framework_TestCase public function testSetCookieConstructor() { $setCookieHeader = new SetCookie( - 'myname', 'myvalue', 'Wed, 13-Jan-2021 22:23:01 GMT', + 'myname', 'myvalue', 'Wed, 13-Jan-2021 22:23:01 GMT', '/accounts', 'docs.foo.com', true, true, 99, 9 ); $this->assertEquals('myname', $setCookieHeader->getName()); @@ -154,7 +154,7 @@ public function testSetCookieCanAppendOtherHeadersInWhenCreatingString() } /** Implmentation specific tests here */ - + /** * @group ZF2-169 */ @@ -180,7 +180,7 @@ public function testGetFieldName() $c = new SetCookie(); $this->assertEquals('Set-Cookie', $c->getFieldName()); } - + /** * @dataProvider validCookieWithInfoProvider */ @@ -189,11 +189,11 @@ public function testGetFieldValue($cStr, $info, $expected) $cookie = SetCookie::fromString($cStr); if (! $cookie instanceof SetCookie) { $this->fail("Failed creating a cookie object from '$cStr'"); - } + } $this->assertEquals($expected, $cookie->getFieldValue()); $this->assertEquals($cookie->getFieldName() . ': ' . $expected, $cookie->toString()); } - + /** * @dataProvider validCookieWithInfoProvider */ @@ -202,7 +202,7 @@ public function testToString($cStr, $info, $expected) $cookie = SetCookie::fromString($cStr); if (! $cookie instanceof SetCookie) { $this->fail("Failed creating a cookie object from '$cStr'"); - } + } $this->assertEquals($cookie->getFieldName() . ': ' . $expected, $cookie->toString()); } diff --git a/test/Header/TETest.php b/test/Header/TETest.php index a9a8565bae..0161739c23 100644 --- a/test/Header/TETest.php +++ b/test/Header/TETest.php @@ -47,6 +47,6 @@ public function testTEToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/TrailerTest.php b/test/Header/TrailerTest.php index 277770ea4c..b94980e2ad 100644 --- a/test/Header/TrailerTest.php +++ b/test/Header/TrailerTest.php @@ -47,6 +47,6 @@ public function testTrailerToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/TransferEncodingTest.php b/test/Header/TransferEncodingTest.php index cf34d1f929..233127a9ad 100644 --- a/test/Header/TransferEncodingTest.php +++ b/test/Header/TransferEncodingTest.php @@ -47,6 +47,6 @@ public function testTransferEncodingToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/UpgradeTest.php b/test/Header/UpgradeTest.php index 6ead9af4f7..449fd34cf2 100644 --- a/test/Header/UpgradeTest.php +++ b/test/Header/UpgradeTest.php @@ -47,6 +47,6 @@ public function testUpgradeToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/UserAgentTest.php b/test/Header/UserAgentTest.php index 76c3184699..8e49fd67e2 100644 --- a/test/Header/UserAgentTest.php +++ b/test/Header/UserAgentTest.php @@ -47,6 +47,6 @@ public function testUserAgentToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/VaryTest.php b/test/Header/VaryTest.php index 7d739ac219..eb2ef81064 100644 --- a/test/Header/VaryTest.php +++ b/test/Header/VaryTest.php @@ -47,6 +47,6 @@ public function testVaryToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/ViaTest.php b/test/Header/ViaTest.php index dc0c438ab2..c963775b6a 100644 --- a/test/Header/ViaTest.php +++ b/test/Header/ViaTest.php @@ -47,6 +47,6 @@ public function testViaToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/WWWAuthenticateTest.php b/test/Header/WWWAuthenticateTest.php index 749524a7e6..fa18284453 100644 --- a/test/Header/WWWAuthenticateTest.php +++ b/test/Header/WWWAuthenticateTest.php @@ -47,6 +47,6 @@ public function testWWWAuthenticateToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + } diff --git a/test/Header/WarningTest.php b/test/Header/WarningTest.php index 5c55fe8185..7b0b0111b9 100644 --- a/test/Header/WarningTest.php +++ b/test/Header/WarningTest.php @@ -47,6 +47,6 @@ public function testWarningToStringReturnsHeaderFormattedString() } /** Implmentation specific tests here */ - + }