1 | <?php |
||
8 | class FileInfoTest extends \PHPUnit_Framework_TestCase |
||
9 | { |
||
10 | /** @var FileInfo */ |
||
11 | private $sut; |
||
12 | |||
13 | /** @var string */ |
||
14 | private $relativePath = ''; |
||
15 | |||
16 | /** @var string */ |
||
17 | private $origBasePath = ''; |
||
18 | |||
19 | /** @var string */ |
||
20 | private $thumbBasePath = ''; |
||
21 | |||
22 | /** @var \PHPUnit_Framework_MockObject_MockObject */ |
||
23 | private $formatterMock; |
||
24 | |||
25 | /** @var \PHPUnit_Framework_MockObject_MockObject */ |
||
26 | private $pathMock; |
||
27 | |||
28 | /** @var \org\bovigo\vfs\vfsStreamDirectory */ |
||
29 | private $uploadDir; |
||
30 | |||
31 | /** @var string */ |
||
32 | private $baseDir; |
||
33 | |||
34 | public function setUp() |
||
64 | |||
65 | private function getSplFileInfoMock() |
||
69 | |||
70 | /** |
||
71 | * @covers DmFileman\Service\FileManager\FileInfo |
||
72 | */ |
||
73 | public function testGetSizeCallsFormatterHelper() |
||
86 | |||
87 | /** |
||
88 | * @covers DmFileman\Service\FileManager\FileInfo |
||
89 | */ |
||
90 | public function testGetPermissionCallsFormatterHelper() |
||
103 | |||
104 | /** |
||
105 | * @covers DmFileman\Service\FileManager\FileInfo |
||
106 | */ |
||
107 | public function testGetOwnerCallsFormatterHelper() |
||
120 | |||
121 | /** |
||
122 | * @covers DmFileman\Service\FileManager\FileInfo |
||
123 | */ |
||
124 | public function testGetGroupCallsFormatterHelper() |
||
137 | |||
138 | /** |
||
139 | * @covers DmFileman\Service\FileManager\FileInfo |
||
140 | */ |
||
141 | public function testGetAccessedAtReturnsEmptyStringWhenSplFileInfoIsNotSet() |
||
149 | |||
150 | /** |
||
151 | * @covers DmFileman\Service\FileManager\FileInfo |
||
152 | */ |
||
153 | public function testGetAccessedAtCallsSplFileInfo() |
||
164 | |||
165 | /** |
||
166 | * @covers DmFileman\Service\FileManager\FileInfo |
||
167 | */ |
||
168 | public function testGetCreatedAtReturnsEmptyStringWhenSplFileInfoIsNotSet() |
||
176 | |||
177 | /** |
||
178 | * @covers DmFileman\Service\FileManager\FileInfo |
||
179 | */ |
||
180 | public function testGetCreatedAtCallsSplFileInfo() |
||
191 | |||
192 | /** |
||
193 | * @covers DmFileman\Service\FileManager\FileInfo |
||
194 | */ |
||
195 | public function testGetModifiedAtReturnsEmptyStringWhenSplFileInfoIsNotSet() |
||
201 | |||
202 | /** |
||
203 | * @covers DmFileman\Service\FileManager\FileInfo |
||
204 | */ |
||
205 | public function testGetModifiedAtCallsSplFileInfo() |
||
216 | |||
217 | /** |
||
218 | * @covers DmFileman\Service\FileManager\FileInfo |
||
219 | */ |
||
220 | public function testGetExtensionCallsPathHelper() |
||
230 | |||
231 | /** |
||
232 | * @covers DmFileman\Service\FileManager\FileInfo |
||
233 | */ |
||
234 | public function testGetDisplayNameReturnsEmptyStringByDefault() |
||
242 | |||
243 | /** |
||
244 | * @covers DmFileman\Service\FileManager\FileInfo |
||
245 | */ |
||
246 | public function testGetDisplayNameReturnsDisplayNameIfSet() |
||
256 | |||
257 | /** |
||
258 | * @covers DmFileman\Service\FileManager\FileInfo |
||
259 | */ |
||
260 | public function testGetDisplayNameCallsSplFileInfoIfDisplayNameIsNotSet() |
||
272 | |||
273 | /** |
||
274 | * @covers DmFileman\Service\FileManager\FileInfo |
||
275 | */ |
||
276 | public function testGetRelativePathCallsPathHelper() |
||
286 | |||
287 | /** |
||
288 | * @covers DmFileman\Service\FileManager\FileInfo |
||
289 | */ |
||
290 | public function testGetOrigPathReturnsEmptyStringByDefault() |
||
298 | |||
299 | /** |
||
300 | * @covers DmFileman\Service\FileManager\FileInfo |
||
301 | */ |
||
302 | public function testGetOrigPathCallsPathHelperIfSplFileInfoIsSet() |
||
315 | |||
316 | /** |
||
317 | * @covers DmFileman\Service\FileManager\FileInfo |
||
318 | */ |
||
319 | public function testGetThumbnailPathCallsPathHelper() |
||
335 | |||
336 | /** |
||
337 | * @covers DmFileman\Service\FileManager\FileInfo |
||
338 | */ |
||
339 | public function testGetImageThumbnailPathCallsPathHelper() |
||
355 | |||
356 | /** |
||
357 | * @expectedException \BadMethodCallException |
||
358 | * @covers DmFileman\Service\FileManager\FileInfo |
||
359 | */ |
||
360 | public function testGetThumbnailPathThrowsExceptionIfSplFileInfoIsNotSet() |
||
364 | |||
365 | /** |
||
366 | * @expectedException \BadMethodCallException |
||
367 | * @covers DmFileman\Service\FileManager\FileInfo |
||
368 | */ |
||
369 | public function testGetImageThumbnailPathThrowsExceptionIfSplFileInfoIsNotSet() |
||
373 | |||
374 | /** |
||
375 | * @covers DmFileman\Service\FileManager\FileInfo |
||
376 | */ |
||
377 | public function testGetTypeThumbnailPathCallsPathHelper() |
||
390 | } |
||
391 |