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