1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00
This commit is contained in:
Cameron
2019-09-03 05:07:06 -07:00
parent 751f2383ec
commit bd29c49f89
5 changed files with 48 additions and 10 deletions

View File

@@ -27,6 +27,8 @@
$this->assertTrue(false, "Couldn't load e107table object"); $this->assertTrue(false, "Couldn't load e107table object");
} }
$this->ns->__construct();
} }
/* /*
public function testGetStyle() public function testGetStyle()

View File

@@ -491,12 +491,23 @@ TMP;
{ {
} }
*/
public function testToText() public function testToText()
{ {
$arr = array(
0 => array('html'=>"<h1><a href='#'>My Caption</a></h1>", 'expected' => 'My Caption'),
1 => array('html'=>"<div><h1><a href='#'>My Caption</a></h1></div>", 'expected' => 'My Caption'),
);
foreach($arr as $var)
{
$result = $this->tp->toText($var['html']);
$this->assertEquals($var['expected'],$result);
} }
}
/*
public function testUstrtolower() public function testUstrtolower()
{ {

View File

@@ -15,11 +15,14 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
public function _before() public function _before()
{ {
try { try
{
$this->scParser = $this->make('e_parse_shortcode'); $this->scParser = $this->make('e_parse_shortcode');
} catch (Exception $e) { }
catch (Exception $e) {
$this->fail("Couldn't create e_parse_shortcode object"); $this->fail("Couldn't create e_parse_shortcode object");
} }
$this->scParser->__construct(); $this->scParser->__construct();
} }
@@ -59,12 +62,32 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit
{ {
} }
*/
public function testParseCodes() public function testParseCodes()
{ {
$text = '<ul class="dropdown-menu {LINK_SUB_OVERSIZED}" role="menu" >';
$array = array(
'LINK_TEXT' => 'Content',
'LINK_URL' => '#',
'ONCLICK' => '',
'SUB_HEAD' => '',
'SUB_MENU' => '',
'ID' => '',
'SUB_ID' => '',
'LINK_CLASS' => 'e-expandit',
'SUB_CLASS' => 'e-hideme e-expandme',
'LINK_IMAGE' => '',
'LINK_SUB_OVERSIZED' => 'oversized',
'LINK_BADGE' => '',
);
$result = $this->scParser->parseCodes($text, false, $array);
// var_dump($result);
} }
/*
public function testInitShortcodeClass() public function testInitShortcodeClass()
{ {

View File

@@ -175,6 +175,8 @@
$xmlArray = $this->_xml->loadXMLfile($file, 'advanced'); $xmlArray = $this->_xml->loadXMLfile($file, 'advanced');
$arr = array(); $arr = array();
foreach($xmlArray['prefs']['core'] as $val) foreach($xmlArray['prefs']['core'] as $val)
@@ -229,7 +231,7 @@
public function testE107Export() public function testE107Export()
{ {
$ret = $this->_xml->e107Export(array('core'), null, null, array('return'=>true)); $ret = $this->_xml->e107Export(array('core'), null, null, null, array('return'=>true));
$incorrect = '<core name="e_jslib_plugin"><![CDATA[Array]]></core>'; $incorrect = '<core name="e_jslib_plugin"><![CDATA[Array]]></core>';
$correct = '<core name="e_jslib_plugin"><![CDATA[array ()]]></core>'; $correct = '<core name="e_jslib_plugin"><![CDATA[array ()]]></core>';