예제 #1
0
 static function setRootDir($new_root)
 {
     if ($new_root instanceof Dir) {
         self::$root_dir = $new_root;
     } else {
         self::$root_dir = new Dir($new_root);
     }
 }
예제 #2
0
 function testDropView()
 {
     ModuleUtils::set_modules_path(FRAMEWORK_CORE_PATH . "tests/base/fakeroot/modules/");
     $db_desc = DB::newDatabaseDescription();
     $this->assertFalse($db_desc->hasTable("vendite_full"), "La vista vendite_full esiste gia'!!");
     DB::newDirectSql($this->create_for_view)->exec();
     DB::newDirectSql($this->create_view)->exec();
     $db_desc = DB::newDatabaseDescription();
     $this->assertTrue($db_desc->hasTable("vendite_full"), "La vista vendite_full non e' stata creata!!");
     $plug = new ModulePlug(new Dir("/" . FRAMEWORK_CORE_PATH . "tests/base/fakeroot/modules/ecommerce/cart/"));
     $def = AvailableModules::get_available_module_definition("ecommerce", "cart");
     $drop_view = $def->get_action_data("drop_view");
     $plug->execute($drop_view);
     $db_desc = DB::newDatabaseDescription();
     $this->assertFalse($db_desc->hasTable("vendite_full"), "La vista vendite_full non e' stata rimossa!!");
     DB::newDirectSql($this->drop_for_view)->exec();
 }