1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-22 05:31:58 +02:00

Null coalescing for e_theme constructor

This commit is contained in:
Nick Liu 2020-01-18 11:59:18 +01:00
parent f5f145485a
commit cf8dc0b909
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637
2 changed files with 3 additions and 0 deletions
e107_handlers
e107_tests/tests/unit

@ -57,6 +57,8 @@ class e_theme
function __construct($options=array())
{
$options['force'] = isset($options['force']) ? $options['force'] : false;
if(!empty($options['themedir']))
{
$this->_current = $options['themedir'];

@ -133,6 +133,7 @@
foreach($tests as $item=>$var)
{
$var['script'] = isset($var['script']) ? $var['script'] : null;
$result = $this->tm->getThemeLayout($pref, $defaultLayout, $var['url'], $var['script']);
$this->assertEquals($var['expected'],$result, "Wrong theme layout returned for item [".$item."] ".$var['url']);