function testExtractFromArchive() { $result_file = new File(ModuleArchiver::MODULES_ARCHIVE_DIR . "test__category-1_2_3.ffa"); $this->assertFalse($result_file->exists(), "Il file del modulo non e' stato creato!!"); ModuleUtils::set_modules_path("/" . FRAMEWORK_CORE_PATH . "tests/modules/fakeroot2/modules/"); ModuleArchiver::save_as_archive("test", "category"); ModuleUtils::set_modules_path("/" . FRAMEWORK_CORE_PATH . "tests/modules/fakeroot2/modules_out/"); ModuleArchiver::extract_from_archive("test__category-1_2_3.ffa"); $extracted_module_dir = new Dir("/" . FRAMEWORK_CORE_PATH . "tests/modules/fakeroot2/modules_out/test/category/"); $this->assertTrue($extracted_module_dir->exists(), "La cartella del modulo non e' stata creata!!"); $module_file = $extracted_module_dir->newFile(AvailableModules::MODULE_DEFINITION_FILE); $this->assertTrue($module_file->exists(), "Il file di definizione del modulo non esiste!!"); $parent_module_dir = $extracted_module_dir->getParentDir(); $parent_module_dir->delete(true); ModuleUtils::set_modules_path("/framework/modules/"); }
function testGetParentDir() { $d1 = new Dir("/" . FRAMEWORK_CORE_PATH . "tests/io/test_dir/empty_dir"); $parent = $d1->getParentDir(); $this->assertEqual(DS . FRAMEWORK_CORE_PATH . "tests/io/test_dir/", $parent->getPath()); }