Skip to content

Commit

Permalink
Merge pull request #68 from TomasVotruba/patch-1
Browse files Browse the repository at this point in the history
[WIP] travis: PHP 5.5+ added, run tests
  • Loading branch information
meenie committed Mar 14, 2015
2 parents 96f632c + 2adba3c commit 11d3717
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
language: php

php:
- 5.3
- 5.4
- 5.3
- 5.5
- 5.6
- 7.0

matrix:
allow_failures:
- php: 7.0

before_script:
- composer install

script:
- phpunit
5 changes: 4 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="tests/bootstrap.php">
<phpunit
bootstrap="tests/bootstrap.php"
colors="true"
>
<testsuites>
<testsuite name="Munee Test Suite">
<directory>./tests/Munee/</directory>
Expand Down
8 changes: 6 additions & 2 deletions tests/Munee/Cases/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testNonCachedResponse()

$this->assertSame($checkHeaders['Cache-Control'], $setHeaders['Cache-Control']);
unset($setHeaders['Cache-Control']);
$this->assertSame($checkHeaders['Content-Type'], $setHeaders['Content-Type']);
$this->assertContains($checkHeaders['Content-Type'], $setHeaders['Content-Type']);
unset($setHeaders['Content-Type']);
$this->assertSame($checkHeaders['Last-Modified'], $setHeaders['Last-Modified']);
unset($setHeaders['Last-Modified']);
Expand Down Expand Up @@ -127,7 +127,7 @@ public function testExpiredRequestResponse()

$this->assertSame($checkHeaders['Cache-Control'], $setHeaders['Cache-Control']);
unset($setHeaders['Cache-Control']);
$this->assertSame($checkHeaders['Content-Type'], $setHeaders['Content-Type']);
$this->assertContains($checkHeaders['Content-Type'], $setHeaders['Content-Type']);
unset($setHeaders['Content-Type']);
$this->assertSame($checkHeaders['Last-Modified'], $setHeaders['Last-Modified']);
unset($setHeaders['Last-Modified']);
Expand Down Expand Up @@ -166,6 +166,10 @@ protected function getHeaders()
foreach ($rawHeaders as $header) {
$headerParts = explode(':', $header, 2);
if (2 == count($headerParts)) {
if ($headerParts[0] === 'Content-type') {
// xdebug incompatible naming
$headerParts[0] = 'Content-Type';
}
$ret[$headerParts[0]] = trim($headerParts[1]);
} elseif (isset($ret[$headerParts[0]])) {
// If a header param is empty, make sure others with the same name are not set as well
Expand Down

0 comments on commit 11d3717

Please sign in to comment.