/**
  * @dataProvider providerGetParent
  */
 public function testGetParent($expected, $value)
 {
     $currentFileSystem = FileSystem::getInstance();
     $windowsFileSystem = new WindowsFileSystem();
     Reflection::setProperty(FileSystem::getInstance(), 'instance', $windowsFileSystem);
     $file = new File($value);
     $this->assertEquals(new File($expected), $windowsFileSystem->getParent($file));
     Reflection::setProperty(FileSystem::getInstance(), 'instance', $currentFileSystem);
 }
Example #2
0
 /**
  * Move this file
  * @param File $destination
  * @return null
  * @throws zibo\library\filesystem\exception\FileSystemException when the file could not be moved
  */
 public function move(File $destination)
 {
     $fs = FileSystem::getInstance();
     $fs->move($this, $destination);
 }
 /**
  * @expectedException zibo\library\filesystem\exception\FileSystemException
  */
 public function testMoveWithUnexistingFileThrowsException()
 {
     $fs = FileSystem::getInstance();
     $source = new File('unexistant');
     $destination = new File('unexistant.move');
     $fs->move($source, $destination);
 }
Example #4
0
 /**
  * Move this file
  * @param File $destination
  * @return null
  * @throws zibo\library\filesystem\exception\FileSystemException when the
  * file could not be moved
  */
 public function move(File $destination)
 {
     $this->fs->move($this, $destination);
 }