mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 07:36:32 +02:00
Eliminated notice failures in e107Test
- FIX: e107::getTemplate() could be run without the necessary plugin LANs - FIX: e107Test::testGetInstance() included e107_config.php too many times - FIX: Empty check in e107Test::testGetTemplate()
This commit is contained in:
@@ -2837,6 +2837,15 @@ class e107
|
|||||||
self::getMessage()->addDebug( "Attempting to load Template File: ".$path );
|
self::getMessage()->addDebug( "Attempting to load Template File: ".$path );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "front" and "global" LANs might not be loaded come self::_getTemplate(),
|
||||||
|
* so the following calls to self::plugLan() fix that.
|
||||||
|
*/
|
||||||
|
self::plugLan($plug_name, null, true);
|
||||||
|
self::plugLan($plug_name, null, false);
|
||||||
|
self::plugLan($plug_name, 'global', true);
|
||||||
|
self::plugLan($plug_name, 'global', false);
|
||||||
|
|
||||||
$id = str_replace('/', '_', $id);
|
$id = str_replace('/', '_', $id);
|
||||||
$ret = self::_getTemplate($id, $key, $reg_path, $path, $info);
|
$ret = self::_getTemplate($id, $key, $reg_path, $path, $info);
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@ class e107Test extends \Codeception\Test\Unit
|
|||||||
public function testInitCore()
|
public function testInitCore()
|
||||||
{
|
{
|
||||||
//$res = null;
|
//$res = null;
|
||||||
include(APP_PATH.'/e107_config.php'); // contains $E107_CONFIG = array('site_path' => '000000test');
|
include_once(APP_PATH.'/e107_config.php'); // contains $E107_CONFIG = array('site_path' => '000000test');
|
||||||
|
|
||||||
$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY','UPLOADS_DIRECTORY','SYSTEM_DIRECTORY', 'MEDIA_DIRECTORY','CACHE_DIRECTORY','LOGS_DIRECTORY', 'CORE_DIRECTORY', 'WEB_DIRECTORY');
|
$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY','UPLOADS_DIRECTORY','SYSTEM_DIRECTORY', 'MEDIA_DIRECTORY','CACHE_DIRECTORY','LOGS_DIRECTORY', 'CORE_DIRECTORY', 'WEB_DIRECTORY');
|
||||||
$sql_info = compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix', 'mySQLport');
|
$sql_info = compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix', 'mySQLport');
|
||||||
@@ -691,12 +691,11 @@ class e107Test extends \Codeception\Test\Unit
|
|||||||
*/
|
*/
|
||||||
public function testGetTemplate()
|
public function testGetTemplate()
|
||||||
{
|
{
|
||||||
|
|
||||||
e107::getConfig()->set('sitetheme', '_blank');
|
e107::getConfig()->set('sitetheme', '_blank');
|
||||||
|
|
||||||
$template = e107::getTemplate('download', null, null); // theme override is enabled by default.
|
$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).
|
$this->assertEquals('{DOWNLOAD_BREADCRUMB} Custom', $template['header']); // ie. should be from _blank theme download template (override of plugin).
|
||||||
$footer = is_null($template['footer']); // theme overrides everything, since merge is not enabled. theme does not contain 'footer'.
|
$footer = empty($template['footer']); // theme overrides everything, since merge is not enabled. theme does not contain 'footer'.
|
||||||
$this->assertTrue($footer);
|
$this->assertTrue($footer);
|
||||||
|
|
||||||
$template = e107::getTemplate('download', null, null, false); // theme override is disabled.
|
$template = e107::getTemplate('download', null, null, false); // theme override is disabled.
|
||||||
|
Reference in New Issue
Block a user