From 9611af013aeac652803cf4cf283b671d349bbb76 Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Tue, 30 Mar 2021 23:53:19 -0500 Subject: [PATCH] Fix undefined constants when e107Test::testGetCoreTemplate() runs first --------- 1) e_navigationTest: Admin links plugins Test tests/unit/e_navigationTest.php:testAdminLinksPlugins Error: ;1m [Error] Undefined constant "E_16_PLUGMANAGER" #1 /__w/e107/e107/e107_handlers/sitelinks_class.php:882 #2 /__w/e107/e107/e107_tests/tests/unit/e_navigationTest.php:528 --------- 2) e_navigationTest: Admin links legacy Test tests/unit/e_navigationTest.php:testAdminLinksLegacy Error: ;1m [Error] Undefined constant "E_32_MAIN" #1 /__w/e107/e107/e107_handlers/sitelinks_class.php:735 #2 /__w/e107/e107/e107_handlers/sitelinks_class.php:887 #3 /__w/e107/e107/e107_tests/tests/unit/e_navigationTest.php:374 --------- 3) e_formTest: Render value Test tests/unit/e_formTest.php:testRenderValue Error: ;1m [Error] Undefined constant "ADMIN_TRUE_ICON" #1 /__w/e107/e107/e107_tests/tests/unit/e_formTest.php:943 --------- 4) scriptsTest: Admin scripts Test tests/unit/scriptsTest.php:testAdminScripts Error: ;1m [Error] Undefined constant "E_32_MAIN" #1 /__w/e107/e107/e107_handlers/sitelinks_class.php:735 #2 /__w/e107/e107/e107_handlers/sitelinks_class.php:887 #3 /__w/e107/e107/e107_admin/includes/infopanel.php:110 #4 /__w/e107/e107/e107_admin/includes/flexpanel.php:66 #5 /__w/e107/e107/e107_admin/admin.php:63 #6 /__w/e107/e107/e107_tests/tests/unit/scriptsTest.php:140 #7 /__w/e107/e107/e107_tests/tests/unit/scriptsTest.php:27 --------- 5) e_formTest: Render value inline Test tests/unit/e_formTest.php:testRenderValueInline Error: ;1m [Error] Undefined constant "ADMIN_FALSE_ICON" #1 /__w/e107/e107/e107_handlers/form_handler.php:5829 #2 /__w/e107/e107/e107_tests/tests/unit/e_formTest.php:1029 --------- 6) e_navigationTest: Admin links sub Test tests/unit/e_navigationTest.php:testAdminLinksSub Error: ;1m [Error] Undefined constant "E_32_MAIN" #1 /__w/e107/e107/e107_handlers/sitelinks_class.php:735 #2 /__w/e107/e107/e107_handlers/sitelinks_class.php:887 #3 /__w/e107/e107/e107_tests/tests/unit/e_navigationTest.php:418 --------- 7) e_parse_shortcodeTest: Admin shortcodes Test tests/unit/e_parse_shortcodeTest.php:testAdminShortcodes Error: ;1m [Error] Undefined constant "E_16_NEWS" #1 /__w/e107/e107/e107_core/shortcodes/batch/admin_shortcodes.php:518 #2 /__w/e107/e107/e107_core/shortcodes/batch/admin_shortcodes.php:602 #3 /__w/e107/e107/e107_handlers/shortcode_handler.php:1130 #4 e_parse_shortcode->doCode #5 /__w/e107/e107/e107_handlers/shortcode_handler.php:996 #6 /__w/e107/e107/e107_handlers/e_parse_class.php:823 #7 /__w/e107/e107/e107_tests/tests/unit/e_parse_shortcodeTest.php:1588 #8 /__w/e107/e107/e107_tests/tests/unit/e_parse_shortcodeTest.php:220 --------- 8) scriptsTest: Admin includes Test tests/unit/scriptsTest.php:testAdminIncludes Error: ;1m [Error] Undefined constant "E_32_MAIN" #1 /__w/e107/e107/e107_handlers/sitelinks_class.php:735 #2 /__w/e107/e107/e107_handlers/sitelinks_class.php:887 #3 /__w/e107/e107/e107_admin/includes/categories.php:22 #4 /__w/e107/e107/e107_tests/tests/unit/scriptsTest.php:140 #5 /__w/e107/e107/e107_tests/tests/unit/scriptsTest.php:36 -- There was 1 failure: --------- 1) e107Test: Load admin icons Test tests/unit/e107Test.php:testLoadAdminIcons E_16_FACEBOOK is missing from admin_icons_template #1 /__w/e107/e107/e107_tests/tests/unit/e107Test.php:1054 --- e107_tests/tests/unit/e107Test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/e107_tests/tests/unit/e107Test.php b/e107_tests/tests/unit/e107Test.php index cd4814a18f..fdcd224a87 100644 --- a/e107_tests/tests/unit/e107Test.php +++ b/e107_tests/tests/unit/e107Test.php @@ -1076,6 +1076,7 @@ public function testGetCoreTemplate() $e107 = $this->e107; $templates = scandir(e_CORE . "templates"); + // Load these constants before other tests fail because of what this test does: $e107::loadAdminIcons(); $exclude = array(