diff --git a/e107_tests/tests/unit/pluginsTest.php b/e107_tests/tests/unit/pluginsTest.php index 37ff33a0d..e367c33e0 100644 --- a/e107_tests/tests/unit/pluginsTest.php +++ b/e107_tests/tests/unit/pluginsTest.php @@ -133,6 +133,83 @@ } + + public function testPluginScripts() + { + + $core = e107::getPlug()->getCorePluginList(); + + $exclude = array( + 'forum/forum_post.php', + 'forum/forum_viewtopic.php', // needs a major cleanup. + 'forum/index.php', + 'online/online_menu.php', // FIXME missing template for member/new + 'pm/pm.php', // FIXME contains exit, needs rework. + 'poll/admin_config.php', // FIXME convert to admin-ui + 'rss_menu/rss.php', // FIXME rework code into class. + 'tagcloud/tagcloud_menu.php', // FIXME - strange (PHP bug?), doesn't see the render() method. + 'tinymce4/wysiwyg.php', // javascript generator. + ); + + //DEBUG A SPECIFIC FILE : dir => file + // $focus = array('tagcloud'=>'tagcloud_menu.php'); + + + foreach($core as $plug) + { + $parm = null; // + e107::plugLan($plug, 'global'); // load global language (usually done in class2.php) + e107::getConfig()->setPref('plug_installed/'.$plug, 1); // simulate installed. + + $path = e_PLUGIN.$plug; + $files = scandir($path); + unset($files[0], $files[1]); // . and .. + + if(!empty($focus) && !isset($focus[$plug])) + { + continue; + } + + foreach($files as $f) + { + $filePath = $path.'/'.$f; + + if(!empty($focus) && $f !== $focus[$plug]) + { + continue; + } + + if(is_dir($filePath) || (strpos($f, '_sql.php') !== false) || strpos($f, '.php') === false || in_array($plug.'/'.$f, $exclude)) + { + continue; + } + + // echo " --- ".$filePath." --- \n"; + if(empty($focus)) + { + ob_start(); + } + require_once( $filePath); + if(empty($focus)) + { + ob_end_clean(); + } + // echo $plug.'/'.$f."\n"; + + } + + } + + + } + + + + + + + + /** * @see https://github.com/e107inc/e107/issues/3547 */