Created
February 24, 2016 06:52
-
-
Save felixmaier1989/b0f94255cdd83192583f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('CakeTestCase', 'TestSuite'); | |
App::uses('HttpSocketResponse', 'Network/Http'); | |
class HeaderTest extends CakeTestCase { | |
public function testParseHeader() { | |
$Response = new DebugHttpSocketResponse(); | |
$header_string = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'header.txt'); | |
$actual = $Response->_parseHeader($header_string); | |
$this->assertEquals('Wed, 24 Feb 2016 06:35:43 GMT', $actual['Date']); | |
$this->assertEquals('PHP/5.5.21', $actual['X-Powered-By']); | |
$this->assertEquals(19, $actual['X-Total-Count']); | |
} | |
} | |
class DebugHttpSocketResponse extends HttpSocketResponse { | |
public function _parseHeader($header) { | |
return parent::_parseHeader($header); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment