public function testMkdirs() { //already existing dir $this->assertTrue(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir')); try { $this->fixture_dir->mkdirs(); $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->mkdirs(); $this->assertTrue(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir')); //non-existing parent dir rmdir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir'); $dir = new LocalFile(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir/myDir2'); $this->assertFalse(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir')); $this->assertFalse(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir/myDir2')); $this->assertTrue($dir->mkdirs()); $this->assertTrue(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir')); $this->assertTrue(is_dir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir/myDir2')); rmdir(TESTS_FSI_LOCALFILE_TMP_PATH . '/myDir/myDir2'); }
/** * @return bool TRUE if the directory and all the needed parent ones have been * successfully created, FALSE otherwise */ public function mkdirs($mode = 0777) { $this->getParentFile()->checkWritePermission(); return parent::mkdirs($mode); }