|
@@ 64-76 (lines=13) @@
|
| 61 |
|
static::assertEquals(CompressionFactory::TYPE_NONE, $file->getCompression()); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
public function testGetFileCompressionForGzipFile() |
| 65 |
|
{ |
| 66 |
|
$file = new LocalFile(static::$dir . 'tobegzipped_file.test'); |
| 67 |
|
$file->put('some random text'); |
| 68 |
|
$gzip = new Gzip(); |
| 69 |
|
$gzipFile = $gzip->compress($file); |
| 70 |
|
|
| 71 |
|
static::assertEquals( |
| 72 |
|
$gzipFile->getCompression(), |
| 73 |
|
$this->findCompression->getCompression($gzipFile) |
| 74 |
|
); |
| 75 |
|
static::assertEquals(Gzip::NAME, $gzipFile->getCompression()); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
public function testGetFileCompressionForZipFile() |
| 79 |
|
{ |
|
@@ 78-90 (lines=13) @@
|
| 75 |
|
static::assertEquals(Gzip::NAME, $gzipFile->getCompression()); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
public function testGetFileCompressionForZipFile() |
| 79 |
|
{ |
| 80 |
|
$file = new LocalFile(static::$dir . 'tobezipped.test'); |
| 81 |
|
$file->put('some random text'); |
| 82 |
|
$zip = new Zip(); |
| 83 |
|
$zipFile = $zip->compress($file); |
| 84 |
|
|
| 85 |
|
static::assertEquals( |
| 86 |
|
$zipFile->getCompression(), |
| 87 |
|
$this->findCompression->getCompression($zipFile) |
| 88 |
|
); |
| 89 |
|
static::assertEquals(Zip::NAME, $zipFile->getCompression()); |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
public function testWhenTheProcessReturnsAnUnknownCompressionUnknownTypeIsReturned() |
| 93 |
|
{ |
|
@@ 146-156 (lines=11) @@
|
| 143 |
|
$this->findCompression->modify($file); |
| 144 |
|
} |
| 145 |
|
|
| 146 |
|
public function testModifyWillSetTheCompression() |
| 147 |
|
{ |
| 148 |
|
$file = new LocalFile(static::$dir . 'tobegzipped_file.test'); |
| 149 |
|
$file->put('some random text'); |
| 150 |
|
$gzip = new Gzip(); |
| 151 |
|
$gzipFile = $gzip->compress($file); |
| 152 |
|
$gzipFile->setCompression(CompressionFactory::TYPE_NONE); |
| 153 |
|
|
| 154 |
|
$gzipFile = $this->findCompression->modify($gzipFile); |
| 155 |
|
static::assertEquals(Gzip::NAME, $gzipFile->getCompression()); |
| 156 |
|
} |
| 157 |
|
} |
| 158 |
|
|