예제 #1
0
 /**
  * @covers   DmFileman\Helper\FileInfo\Path
  * @requires PHP 5.6
  */
 public function testGetThumbnailPathGetsTypeThumbnailPathIfNoSpecialImagePathWasFound()
 {
     $image = vfs\vfsStream::url('upload/orig/img.jpg');
     $splFileInfoMock = $this->getMock('\\SplFileInfo', ['isFile', 'getExtension', 'isDir'], [], '', false);
     $splFileInfoMock->expects($this->any())->method('isFile')->will($this->returnValue(true));
     $splFileInfoMock->expects($this->any())->method('isDir')->will($this->returnValue(false));
     $splFileInfoMock->expects($this->any())->method('getExtension')->will($this->returnValue('xyz'));
     $pathname = $image;
     $displayName = basename($image);
     $thumbBasePath = '/upload/thumb';
     $relativePath = '/';
     $actualResult = $this->sut->getThumbnailPath($splFileInfoMock, $pathname, $displayName, $thumbBasePath, $relativePath);
     $this->assertEquals('/img/filemanager/fileicon_bg.png', $actualResult);
 }
예제 #2
0
 /**
  * @return string
  */
 public function getThumbnailPath()
 {
     return $this->pathHelper->getThumbnailPath($this->splFileInfo, $this->getPathname(), $this->getDisplayName(), $this->thumbBasePath, $this->relativePath);
 }