diff --git a/tests/unit/ConstantsTest.php b/tests/unit/ConstantsTest.php index 82f682685..2fa0c6c4e 100644 --- a/tests/unit/ConstantsTest.php +++ b/tests/unit/ConstantsTest.php @@ -57,4 +57,44 @@ $this->assertTrue($res); } + + public function testVerifyE107_INIT() + { + $res = true; + + if(!defined('e107_INIT')) + { + $res = false; + } + + $this->assertTrue($res); + } + + + public function testVerifyUSERCLASS_LIST() + { + $res = true; + + if(!defined('USERCLASS_LIST')) + { + $res = false; + } + + $this->assertTrue($res); + } + + + public function testVerifye_ROOT() + { + $res = true; + + if(!defined('e_ROOT')) + { + $res = false; + } + + $this->assertTrue($res); + + + } } diff --git a/tests/unit/e107pluginTest.php b/tests/unit/e107pluginTest.php new file mode 100644 index 000000000..856c9e7f1 --- /dev/null +++ b/tests/unit/e107pluginTest.php @@ -0,0 +1,302 @@ +tp = $this->make('e107_plugin'); + } + catch (Exception $e) + { + $this->assertTrue(false, "Couldn't e107_plugi object"); + } + + } + +/* + + public function testDisplayArray() + { + + } + + public function testExecute_function() + { + + } + + public function testManage_plugin_prefs() + { + + } + + public function testInstall() + { + + } + + public function testGetall() + { + + } + + public function testXmlPrefs() + { + + } + + public function testParse_plugin_php() + { + + } + + public function testRefresh() + { + + } + + public function testUninstall() + { + + } + + public function testRebuildUrlConfig() + { + + } + + public function testManage_icons() + { + + } + + public function testParse_plugin() + { + + } + + public function testManage_comments() + { + + } + + public function testManage_search() + { + + } + + public function testInstall_plugin_xml() + { + + } + + public function testGetAddonsDiz() + { + + } + + public function testUpdate_plugins_table() + { + + } + + public function testXmlBBcodes() + { + + } + + public function testInstall_plugin() + { + + } + + public function testManage_extended_field_sql() + { + + } + + public function testUpdateRequired() + { + + } + + public function testGetCorePlugins() + { + + } + + public function testManage_prefs() + { + + } + + public function testGetPerm() + { + + } + + public function testGetAddonsList() + { + + } + + public function testXmlExtendedFields() + { + + } + + public function testGetAddons() + { + + } + + public function testUe_field_type() + { + + } + + public function testManage_userclass() + { + + } + + public function testXmlSiteLinks() + { + + } + + public function testGetIcon() + { + + } + + public function testGetId() + { + + } + + public function testXmlLanguageFileCheck() + { + + } + + public function testSetUe() + { + + } + + public function testManage_tables() + { + + } + + public function testInstall_plugin_php() + { + + } + + public function testXmlMediaCategories() + { + + } + + public function testXmlDependencies() + { + + } + + public function testXmlTables() + { + + } + + public function testXmlUserClasses() + { + + } + + public function testCheckAddon() + { + + } + + public function testManage_notify() + { + + } + + public function testUe_field_type_name() + { + + } + + public function testManage_link() + { + + } + + public function testUe_field_name() + { + + } + + public function testIsUsedByAnotherPlugin() + { + + } + + public function testGetOtherPlugins() + { + + } + + public function testGetLog() + { + + } + + public function testManage_category() + { + + } + + public function testGetinfo() + { + + } + + public function testXmlAdminLinks() + { + + } + + public function testXmlLanguageFiles() + { + + } + + public function testManage_extended_field() + { + + } + + public function testParse_plugin_xml() + { + + }*/ + } diff --git a/tests/unit/pluginsTest.php b/tests/unit/pluginsTest.php new file mode 100644 index 000000000..a329be3b2 --- /dev/null +++ b/tests/unit/pluginsTest.php @@ -0,0 +1,125 @@ +_plg = $this->make('e107plugin'); + } + catch (Exception $e) + { + $this->assertTrue(false, "Couldn't load e107plugin object"); + }*/ + } + + private function dumpInfo($plugin) + { + + $tp = e107::getParser(); + + echo "Log ------------\n"; + $log = e107::getPlugin()->getLog(); + + foreach($log as $line) + { + echo " - ".$line."\n"; + } + echo "-------------------\n\n"; + + echo "-- Pref: plug_installed (version)\n\n"; + $pref = e107::getConfig('core',true,true)->get('plug_installed'); + + print_r($pref[$plugin]); + + echo "\n-- Plugin Prefs: \n\n"; + $table = e107::pref($plugin); + print_r($table); + + + echo "\n-- Plugin Table: ".$plugin."\n\n"; + $table = e107::getDb()->retrieve('plugin','*', "plugin_path='".$plugin."' LIMIT 1", true); + print_r($table); + + echo "\n-- Menu Table: ".$plugin."\n\n"; + $table = e107::getDb()->retrieve('menus','*', "menu_location = 0 AND menu_path='".$plugin."/' LIMIT 10", true); + print_r($table); + + echo "\n-- Site Links Table: ".$plugin."\n\n"; + $table = e107::getDb()->retrieve('links','*', "link_owner='".$plugin."' ", true); + print_r($table); + + $dir = scandir(e_PLUGIN.$plugin); + $corePref = e107::getConfig('core',true,true)->getPref(); + + + echo "\n-- Addons\n\n"; + echo "----------------------------------------\n"; + echo "Addon file\t\tIn Core pref e_xxxx_list\n\n"; + foreach($dir as $file) + { + $name = basename($file,".php"); + + if(substr($file,0,2) === 'e_') + { + $key = $name."_list"; + $status = !empty($corePref[$key][$plugin]) ? 'YES' : 'NO'; + + echo $file."\t\t".$status."\n"; + + } + } + + echo "----------------------------------------\n\n\n"; + + + + + + } + + function testBanner() + { + + e107::getPlugin()->install('banner'); + + $tp = e107::getParser(); + + $result = $tp->parseTemplate("{BANNER=e107promo}",true); + + $this->assertContains(" 1, + 'delete_files' => 0 + ); + + e107::getPlugin()->uninstall('banner', $opts); + + $result = $tp->parseTemplate("{BANNER=e107promo}",true); // should return null since plugin is uninstalled. + + // $this->dumpInfo('banner'); // see more values to test + + } + + + + + + + + + }