array ( 0 => '/e107_admin/administrator.php', 1 => 'Administrators', 2 => 'Add/delete site administrators', 3 => '3', 4 => 2, 5 => '', 6 => '', ), 1 => array ( 0 => '/e107_admin/updateadmin.php', 1 => 'Admin password', 2 => 'Change your password', 3 => false, 4 => 2, 5 => '', 6 => '', ), 2 => array ( 0 => '/e107_admin/banlist.php', 1 => 'Banlist', 2 => 'Ban visitors', 3 => '4', 4 => 2, 5 => '', 6 => '', ), 4 => array ( 0 => '/e107_admin/cache.php', 1 => 'Cache', 2 => 'Set cache status', 3 => 'C', 4 => 1, 5 => '', 6 => ' ', ), 5 => array ( 0 => '/e107_admin/cpage.php', 1 => 'Pages/Menus', 2 => 'Create menu items', 3 => '5|J', 4 => 3, 5 => '', 6 => ' ', ), 6 => array ( 0 => '/e107_admin/db.php', 1 => 'Database', 2 => 'Database utilities', 3 => '0', 4 => 4, 5 => '', 6 => ' ', ), 8 => array ( 0 => '/e107_admin/emoticon.php', 1 => 'Emoticons', 2 => 'Configure emoticons', 3 => 'F', 4 => 1, 5 => '', 6 => ' ', ), 10 => array ( 0 => '/e107_admin/frontpage.php', 1 => 'Front Page', 2 => 'Configure front page content', 3 => 'G', 4 => 1, 5 => '', 6 => ' ', ), 11 => array ( 0 => '/e107_admin/image.php', 1 => 'Media Manager', 2 => 'Media Manager', 3 => 'A', 4 => 5, 5 => '', 6 => ' ', ), 12 => array ( 0 => '/e107_admin/links.php', 1 => 'Navigation', 2 => 'Add/edit/delete links', 3 => 'I', 4 => 1, 5 => '', 6 => ' ', ), 13 => array ( 0 => '/e107_admin/wmessage.php', 1 => 'Welcome Message', 2 => 'Set static welcome message', 3 => 'M', 4 => 3, 5 => '', 6 => ' ', ), 14 => array ( 0 => '/e107_admin/ugflag.php', 1 => 'Maintenance', 2 => 'Take site down for maintenance', 3 => '9', 4 => 4, 5 => '', 6 => ' ', ), 15 => array ( 0 => '/e107_admin/menus.php', 1 => 'Menu Manager', 2 => 'Alter the order of your menus', 3 => '2', 4 => 5, 5 => '', 6 => ' ', ), 16 => array ( 0 => '/e107_admin/meta.php', 1 => 'Meta Tags', 2 => 'Add/Edit site meta tags', 3 => 'T', 4 => 1, 5 => '', 6 => ' ', ), 17 => array ( 0 => '/e107_admin/newspost.php', 1 => 'News', 2 => 'Manage news items', 3 => 'H|N|7|H0|H1|H2|H3|H4|H5', 4 => 3, 5 => '', 6 => ' ', ), 18 => array ( 0 => '/e107_admin/phpinfo.php', 1 => 'PHP Info', 2 => 'PHP Info page', 3 => '0', 4 => 20, 5 => '', 6 => ' ', ), 19 => array ( 0 => '/e107_admin/prefs.php', 1 => 'Preferences', 2 => 'Edit Site Preferences', 3 => '1', 4 => 1, 5 => '', 6 => ' ', ), 20 => array ( 0 => '/e107_admin/search.php', 1 => 'Search', 2 => 'Search Configuration', 3 => 'X', 4 => 1, 5 => '', 6 => ' ', ), 21 => array ( 0 => '/e107_admin/admin_log.php', 1 => 'System Logs', 2 => 'Admin log, user audit, rolling log', 3 => 'S', 4 => 4, 5 => '', 6 => ' ', ), 22 => array ( 0 => '/e107_admin/theme.php', 1 => 'Theme Manager', 2 => 'Click here to install and configure themes, which control the appearance of your site.', 3 => '1|TMP', 4 => 5, 5 => '', 6 => ' ', ), 23 => array ( 0 => '/e107_admin/upload.php', 1 => 'Public Uploads', 2 => 'Configure public file uploads', 3 => 'V', 4 => 3, 5 => '', 6 => ' ', ), 24 => array ( 0 => '/e107_admin/users.php', 1 => 'Users', 2 => 'Moderate site members', 3 => '4|U0|U1|U2|U3', 4 => 2, 5 => '', 6 => ' ', ), 25 => array ( 0 => '/e107_admin/userclass2.php', 1 => 'User Classes', 2 => 'Create/edit user classes', 3 => '4', 4 => 2, 5 => '', 6 => ' ', ), 26 => array ( 0 => '/e107_admin/language.php', 1 => 'Language', 2 => 'default', 3 => 'L', 4 => 1, 5 => '', 6 => ' ', ), 27 => array ( 0 => '/e107_admin/mailout.php', 1 => 'Mail', 2 => 'Email Settings And Mailout', 3 => 'W', 4 => 2, 5 => '', 6 => ' ', ), 28 => array ( 0 => '/e107_admin/users_extended.php', 1 => 'Extended User Fields', 2 => 'Edit extended user fields', 3 => '4', 4 => 2, 5 => '', 6 => ' ', ), 29 => array ( 0 => '/e107_admin/fileinspector.php', 1 => 'File Inspector', 2 => 'Scan site files', 3 => 'Y', 4 => 4, 5 => '', 6 => ' ', ), 30 => array ( 0 => '/e107_admin/notify.php', 1 => 'Notify', 2 => 'Admin Email Notifications', 3 => 'O', 4 => 4, 5 => '', 6 => ' ', ), 31 => array ( 0 => '/e107_admin/cron.php', 1 => 'Schedule Tasks', 2 => 'Cron Jobs and Automated Maintenance', 3 => 'U', 4 => 4, 5 => '', 6 => ' ', ), 32 => array ( 0 => '/e107_admin/eurl.php', 1 => 'URL Configuration', 2 => 'Configure Site URLs', 3 => 'K', 4 => 1, 5 => '', 6 => ' ', ), 33 => array ( 0 => '/e107_admin/plugin.php', 1 => 'Plugin Manager', 2 => 'Click here to install, maintain and configure plugins which provide additional features on your site.', 3 => 'Z', 4 => 5, 5 => '', 6 => ' ', ), 34 => array ( 0 => '/e107_admin/docs.php', 1 => 'Docs', 2 => 'System documentation', 3 => false, 4 => 20, 5 => '', 6 => ' ', ), 36 => array ( 0 => '/e107_admin/credits.php', 1 => 'Credits', 2 => 'Credits', 3 => false, 4 => 20, 5 => '\'\'', 6 => '\'\'', ), 38 => array ( 0 => '/e107_admin/comment.php', 1 => 'Comments Manager', 2 => 'Comments Manager', 3 => 'B', 4 => 5, 5 => '', 6 => ' ', ), ); $result = e107::getNav()->adminLinks('legacy'); $this->assertSame($expected, $result); } public function testAdminLinksSub() { $expected = array ( 17 => array ( 0 => array ( 0 => './e107_admin/newspost.php', 1 => 'Manage', 2 => 'News items List', 3 => 'H', 4 => 3, 5 => '', 6 => ' ', ), 1 => array ( 0 => './e107_admin/newspost.php?create', 1 => 'Create', 2 => 'Create news item', 3 => 'H', 4 => 3, 5 => '', 6 => ' ', ), 2 => array ( 0 => './e107_admin/newspost.php?pref', 1 => 'Preferences', 2 => 'Preferences', 3 => 'H', 4 => 3, 5 => '', 6 => ' ', ), ), ); $result = e107::getNav()->adminLinks('sub'); $this->assertSame($expected, $result); } public function testAdminLinksPlugins() { e107::loadAdminIcons(); $expected = array ( /* 'plugnav-featurebox' => array ( 'text' => 'Feature Box', 'description' => 'Displays an animated area on the top of your page with news-items and other content you would like to feature.', 'link' => '/e107_plugins/featurebox/admin_config.php', 'image' => 'Feature Box', 'image_large' => 'Feature Box', 'category' => 'content', 'perm' => 'P8', 'sort' => 2, 'sub_class' => NULL, 'key' => 'plugnav-featurebox', 'title' => 'Feature Box', 'caption' => 'Configure feature box', 'perms' => 'P8', 'icon' => 'Feature Box', 'icon_32' => 'Feature Box', 'cat' => 3, ), 'plugnav-gallery' => array ( 'text' => 'Gallery', 'description' => 'A simple image gallery', 'link' => '/e107_plugins/gallery/admin_gallery.php', 'image' => 'Gallery', 'image_large' => 'Gallery', 'category' => 'content', 'perm' => 'P10', 'sort' => 2, 'sub_class' => NULL, 'key' => 'plugnav-gallery', 'title' => 'Gallery', 'caption' => 'Configure', 'perms' => 'P10', 'icon' => 'Gallery', 'icon_32' => 'Gallery', 'cat' => 3, ), 'plugnav-rss_menu' => array ( 'text' => 'RSS', 'description' => 'RSS Feeds from your site.', 'link' => '/e107_plugins/rss_menu/admin_prefs.php', 'image' => 'RSS', 'image_large' => 'RSS', 'category' => 'misc', 'perm' => 'P24', 'sort' => 2, 'sub_class' => NULL, 'key' => 'plugnav-rss_menu', 'title' => 'RSS', 'caption' => 'Configure', 'perms' => 'P24', 'icon' => 'RSS', 'icon_32' => 'RSS', 'cat' => 7, ), */ 'plugnav-social' => array ( 'text' => 'Social', 'description' => 'Adds options to replace the e107 comment engine with Facebook. Add Twitter feeds to your site. etc.', 'link' => '/e107_plugins/social/admin_config.php', 'image' => 'Social', 'image_large' => 'Social', 'category' => 'settings', 'perm' => 'P26', 'sort' => 2, 'sub_class' => NULL, 'key' => 'plugnav-social', 'title' => 'Social', 'caption' => false, 'perms' => 'P26', 'icon' => 'Social', 'icon_32' => 'Social', 'cat' => 1, ), 'plugnav-tinymce4' => array ( 'text' => 'TinyMce4', 'description' => 'TinyMce4 CDN version', 'link' => '/e107_plugins/tinymce4/admin_config.php', 'image' => 'TinyMce4', 'image_large' => 'TinyMce4', 'category' => 'misc', 'perm' => 'P28', 'sort' => 2, 'sub_class' => NULL, 'key' => 'plugnav-tinymce4', 'title' => 'TinyMce4', 'caption' => 'Configure', 'perms' => 'P28', 'icon' => 'TinyMce4', 'icon_32' => 'TinyMce4', 'cat' => 7, ), ); $result = e107::getNav()->adminLinks('plugin2'); foreach($expected as $key=>$val) { $this->assertArrayHasKey($key,$result); } } /* public function testPlugCatToCoreCat() { } public function testGetDefaultAdminPanelArray() { } public function testRenderAdminButton() { } public function testPluginLinks() { } */ public function testAdminCats() { $expected = array ( 'title' => array ( 1 => 'Settings', 2 => 'Users', 3 => 'Content', 4 => 'Tools', 5 => 'Manage', 6 => 'Misc', 20 => 'About', ), 'id' => array ( 1 => 'setMenu', 2 => 'userMenu', 3 => 'contMenu', 4 => 'toolMenu', 5 => 'managMenu', 6 => 'miscMenu', 20 => 'aboutMenu', ), 'img' => array ( 1 => 'fa-cogs.glyph', 2 => 'fa-users.glyph', 3 => 'fa-file-text-o.glyph', 4 => 'fa-wrench.glyph', 5 => 'fa-desktop.glyph', 6 => 'fa-puzzle-piece.glyph', 20 => 'fa-info-circle.glyph', ), 'lrg_img' => array ( 1 => '', 2 => '', 3 => '', 4 => '', 5 => '', 6 => '', 20 => '', ), 'sort' => array ( 1 => true, 2 => true, 3 => true, 4 => true, 5 => true, 6 => true, 20 => false, ), ); $result = e107::getNav()->adminCats(); $this->assertSame($expected, $result); } /* public function testCacheBase() { } public function testIsActive() { } public function testSetIconArray() { } public function testAdmin() { } public function testGetIconArray() { } public function testInitData() { }*/ }