From bdab296cae7b27f71a28b2c24e66ce7677bdc584 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 8 Jan 2021 10:15:40 -0800 Subject: [PATCH] Possible test fix. --- e107_core/shortcodes/single/user_extended.php | 6 ++++-- e107_tests/tests/unit/e107Test.php | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/e107_core/shortcodes/single/user_extended.php b/e107_core/shortcodes/single/user_extended.php index 3e06012ce..755ed38fc 100644 --- a/e107_core/shortcodes/single/user_extended.php +++ b/e107_core/shortcodes/single/user_extended.php @@ -110,11 +110,13 @@ if ($parms[1] == 'text') { - if(!isset($ueStruct['user_'.$parms[0]])) + if(!isset($parms[0]) || !isset($ueStruct['user_'.$parms[0]]) || !isset($ueStruct['user_'.$parms[0]]['user_extended_struct_text'])) { - return FALSE; + return false; } + $text_val = $ueStruct['user_'.$parms[0]]['user_extended_struct_text']; + if($text_val) { return (defined($text_val) ? constant($text_val) : $text_val); diff --git a/e107_tests/tests/unit/e107Test.php b/e107_tests/tests/unit/e107Test.php index 24eac4bad..4f27c306c 100644 --- a/e107_tests/tests/unit/e107Test.php +++ b/e107_tests/tests/unit/e107Test.php @@ -714,6 +714,7 @@ class e107Test extends \Codeception\Test\Unit public function testGetTemplate() { e107::getConfig()->set('sitetheme', '_blank'); + require_once(e_PLUGIN."download/languages/English/English_front.php"); // LANS in template files. $template = e107::getTemplate('download', null, null); // theme override is enabled by default. $this->assertEquals('{DOWNLOAD_BREADCRUMB} Custom', $template['header']); // ie. should be from _blank theme download template (override of plugin).