subject = new ContentDetector(); parent::setUp(); } public function testIsNotGzip(): void { $this->assertFalse($this->subject->isGzip(stream_for('string'))); $this->assertFalse($this->subject->isGzip($this->getFileStream(__FILE__))); $this->assertFalse($this->subject->isGzip(stream_for(base64_decode(self::ENCODED_IMAGE)))); if (function_exists('gzencode')) { $this->assertTrue($this->subject->isGzip(stream_for(gzencode('string')))); } else { $this->markTestIncomplete('No ZLIB installed'); } $this->assertTrue($this->subject->isGzip(stream_for(stream_for(base64_decode(self::ENCODED_GZIP))))); } public function testIsGzipableMime(): void { $this->assertFalse($this->subject->isGzipableMime('text/html')); $this->assertTrue($this->subject->isGzipableMime(tao_helpers_File::MIME_SVG)); } private function getFileStream($path): StreamInterface { return stream_for(fopen($path, 'rb')); } }