Skip to content

Commit

Permalink
Support for PHPUnit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed May 4, 2019
1 parent 0e66396 commit 08756f8
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions e107_handlers/plugin_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3768,6 +3768,8 @@ function XmlExtendedFields($function, $array)
$mes = e107::getMessage();
$this->setUe();

$ret = array();

foreach ($array['field'] as $efield)
{
$attrib = $efield['@attributes'];
Expand All @@ -3780,8 +3782,14 @@ function XmlExtendedFields($function, $array)
$source = 'plugin_'.$this->plugFolder;
$remove = (varset($attrib['deprecate']) == 'true') ? TRUE : FALSE;

if(!isset($attrib['system'])) $attrib['system'] = true; // default true
else $attrib['system'] = $attrib['system'] === 'true' ? true : false;
if(!isset($attrib['system']))
{
$attrib['system'] = true; // default true
}
else
{
$attrib['system'] = ($attrib['system'] === 'true') ? true : false;
}

switch ($function)
{
Expand Down Expand Up @@ -3816,9 +3824,18 @@ function XmlExtendedFields($function, $array)
$mes->add(EPL_ADLAN_251 .$name, E_MESSAGE_SUCCESS);
}
break;

case 'test': // phpunit
$ret[] = array('name' => $name, 'attrib' => $attrib, 'source' => $source);
break;
}
}

if(!empty($ret))
{
return $ret;
}

return null;
}

Expand Down

0 comments on commit 08756f8

Please sign in to comment.