summaryrefslogtreecommitdiff
path: root/server/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php
diff options
context:
space:
mode:
authorEoleDev <root@serverpc.home>2016-03-09 16:03:46 +0100
committerEoleDev <root@serverpc.home>2016-03-09 16:03:46 +0100
commit03ef74d0cfe675a6e18a91f039182ca1b248d8f5 (patch)
treeb1668c59fdbf9cb0b0a3da52bfc79e393a953573 /server/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php
parent1d3ed3af6d57316640c143002ddf80d61e6c098a (diff)
MAJ Librarys
Diffstat (limited to 'server/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php')
-rw-r--r--server/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/server/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php b/server/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php
index 927fc0b..0e4b586 100644
--- a/server/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php
+++ b/server/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php
@@ -13,4 +13,27 @@ class InflateStreamtest extends \PHPUnit_Framework_TestCase
$b = new InflateStream($a);
$this->assertEquals('test', (string) $b);
}
+
+ public function testInflatesStreamsWithFilename()
+ {
+ $content = $this->getGzipStringWithFilename('test');
+ $a = Psr7\stream_for($content);
+ $b = new InflateStream($a);
+ $this->assertEquals('test', (string) $b);
+ }
+
+ private function getGzipStringWithFilename($original_string)
+ {
+ $gzipped = bin2hex(gzencode($original_string));
+
+ $header = substr($gzipped, 0, 20);
+ // set FNAME flag
+ $header[6]=0;
+ $header[7]=8;
+ // make a dummy filename
+ $filename = "64756d6d7900";
+ $rest = substr($gzipped, 20);
+
+ return hex2bin($header . $filename . $rest);
+ }
}