1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 01:54:12 +02:00

PHP error fixes.

This commit is contained in:
Cameron
2021-02-22 12:22:50 -08:00
parent 340ff05fcd
commit 52a554987b
3 changed files with 34 additions and 5 deletions

View File

@@ -105,6 +105,32 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
}
public function testParseCodesWithMagicShortcodes()
{
$template = '{SITENAME} {---BREADCRUMB---}';
$expected = 'e107 {---BREADCRUMB---}';
$result = $this->scParser->parseCodes($template, true);
$this->assertSame($expected, $result);
$array = array(
'LINK_TEXT' => 'Content',
'LINK_URL' => '#',
'ONCLICK' => '',
'SUB_HEAD' => '',
'SUB_MENU' => '',
);
$result = $this->scParser->parseCodes($template, true, $array);
$this->assertSame($expected, $result);
$sc = e107::getScBatch('_blank', true, '_blank');
$this->assertIsObject($sc);
$result = $this->scParser->parseCodes($template, true, $sc);
$this->assertSame($expected, $result);
}
public function testParseCodesWithClass()
{

View File

@@ -515,11 +515,13 @@
);
$themeObj = $this->tm;
foreach($tests as $item=>$var)
{
$var['script'] = isset($var['script']) ? $var['script'] : null;
$result = $this->tm::getThemeLayout($pref, $defaultLayout, $var);
$result = $themeObj::getThemeLayout($pref, $defaultLayout, $var);
$this->assertEquals($var['expected'],$result, "Wrong theme layout returned for item [".$item."] ".$var['url']);
// echo $var['url']."\t\t\t".$result."\n\n";
}