Exemplo n.º 1
0
 /**
  * @covers   DmFileman\Helper\FileInfo\Path
  * @requires PHP 5.6
  */
 public function testGetRelativePathReturnsGivenPathWithAppendedFileNameAndSlashForDirectories()
 {
     $relativePath = 'foo/';
     $filename = 'bar';
     $splFileInfoMock = $this->getMock('\\SplFileInfo', ['getFilename', 'isDir'], [], '', false);
     $splFileInfoMock->expects($this->any())->method('getFilename')->will($this->returnValue($filename));
     $splFileInfoMock->expects($this->any())->method('isDir')->will($this->returnValue(true));
     $actualResult = $this->sut->getRelativePath(true, false, $splFileInfoMock, $relativePath);
     $this->assertEquals($relativePath . $filename . '/', $actualResult);
 }
Exemplo n.º 2
0
 /**
  * @param bool $withFilename
  *
  * @return string
  */
 public function getRelativePath($withFilename = false)
 {
     return $this->pathHelper->getRelativePath($withFilename, $this->withFilenameDisabled, $this->splFileInfo, $this->relativePath);
 }