Beispiel #1
0
 public function testMkdir()
 {
     //already existing dir
     $this->assertTrue(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir'));
     try {
         $this->fixture_dir->mkdir();
         $this->fail();
     } catch (EyeIOException $e) {
         //normal situation
     }
     //non-existing dir
     rmdir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir');
     $this->assertFalse(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir'));
     $this->fixture_dir->mkdir();
     $this->assertTrue(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir'));
     //non-existing parent dir
     rmdir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir');
     $dir2 = new LocalFile(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir/myDir2');
     $this->assertFalse(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir/myDir2'));
     try {
         $dir2->mkdir();
         $this->fail();
     } catch (EyeIOException $e) {
         //normal situation
     }
 }
Beispiel #2
0
 /**
  * @return bool TRUE if the directory has been successfully created, FALSE otherwise
  */
 public function mkdir($mode = 0777)
 {
     $this->getParentFile()->checkWritePermission();
     return parent::mkdir($mode);
 }