@@ 77-89 (lines=13) @@ | ||
74 | static::assertEquals(CompressionFactory::TYPE_NONE, $file->getCompression()); |
|
75 | } |
|
76 | ||
77 | public function testGetFileCompressionForGzipFile() |
|
78 | { |
|
79 | $file = new LocalFile(static::$dir . 'tobegzipped_file.test'); |
|
80 | $file->put('some random text'); |
|
81 | $gzip = new Gzip(); |
|
82 | $gzipFile = $gzip->compress($file); |
|
83 | ||
84 | static::assertEquals( |
|
85 | $gzipFile->getCompression(), |
|
86 | $this->findCompression->getCompression($gzipFile) |
|
87 | ); |
|
88 | static::assertEquals(Gzip::NAME, $gzipFile->getCompression()); |
|
89 | } |
|
90 | ||
91 | public function testGetFileCompressionForZipFile() |
|
92 | { |
|
@@ 91-103 (lines=13) @@ | ||
88 | static::assertEquals(Gzip::NAME, $gzipFile->getCompression()); |
|
89 | } |
|
90 | ||
91 | public function testGetFileCompressionForZipFile() |
|
92 | { |
|
93 | $file = new LocalFile(static::$dir . 'tobezipped.test'); |
|
94 | $file->put('some random text'); |
|
95 | $zip = new Zip(); |
|
96 | $zipFile = $zip->compress($file); |
|
97 | ||
98 | static::assertEquals( |
|
99 | $zipFile->getCompression(), |
|
100 | $this->findCompression->getCompression($zipFile) |
|
101 | ); |
|
102 | static::assertEquals(Zip::NAME, $zipFile->getCompression()); |
|
103 | } |
|
104 | ||
105 | public function testWhenTheProcessReturnsAnUnknownCompressionUnknownTypeIsReturned() |
|
106 | { |
|
@@ 162-172 (lines=11) @@ | ||
159 | $this->findCompression->modify($file); |
|
160 | } |
|
161 | ||
162 | public function testModifyWillSetTheCompression() |
|
163 | { |
|
164 | $file = new LocalFile(static::$dir . 'tobegzipped_file.test'); |
|
165 | $file->put('some random text'); |
|
166 | $gzip = new Gzip(); |
|
167 | $gzipFile = $gzip->compress($file); |
|
168 | $gzipFile->setCompression(CompressionFactory::TYPE_NONE); |
|
169 | ||
170 | $gzipFile = $this->findCompression->modify($gzipFile); |
|
171 | static::assertEquals(Gzip::NAME, $gzipFile->getCompression()); |
|
172 | } |
|
173 | } |
|
174 |