@@ 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 | { |
|
@@ 149-159 (lines=11) @@ | ||
146 | $this->findCompression->modify($file); |
|
147 | } |
|
148 | ||
149 | public function testModifyWillSetTheCompression() |
|
150 | { |
|
151 | $file = new LocalFile(static::$dir . 'tobegzipped_file.test'); |
|
152 | $file->put('some random text'); |
|
153 | $gzip = new Gzip(); |
|
154 | $gzipFile = $gzip->compress($file); |
|
155 | $gzipFile->setCompression(CompressionFactory::TYPE_NONE); |
|
156 | ||
157 | $gzipFile = $this->findCompression->modify($gzipFile); |
|
158 | static::assertEquals(Gzip::NAME, $gzipFile->getCompression()); |
|
159 | } |
|
160 | } |
|
161 |