1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 22:27:34 +02:00

Possible fixes.

This commit is contained in:
Cameron
2019-12-04 10:10:32 -08:00
committed by Deltik
parent 369142af55
commit 3b28884b56
2 changed files with 64 additions and 62 deletions

View File

@@ -1044,64 +1044,63 @@ class e_formTest extends \Codeception\Test\Unit
public function testRenderLink() public function testRenderLink()
{ {
# FIXME: https://github.com/e107inc/e107/issues/4032 $tests = array(
// $tests = array( 0 => array(
// 0 => array( 'value' => 'Some text',
// 'value' => 'Some text', 'parms' => array('link'=>'myurl.php', 'target'=>'blank'),
// 'parms' => array('link'=>'myurl.php', 'target'=>'blank'), 'expected' => "<a class='e-tip' rel='external' href='myurl.php' title='Quick View' >Some text</a>"
// 'expected' => "<a class='e-tip' rel='external' href='myurl.php' title='Quick View' >Some text</a>" ),
// ), 1 => array(
// 1 => array( 'value' => 'Some text',
// 'value' => 'Some text', 'parms' => array('link'=>'myurl.php?id=[id]', 'target'=>'modal'),
// 'parms' => array('link'=>'myurl.php?id=[id]', 'target'=>'modal'), 'expected' => "<a class='e-tip' href='myurl.php?id=3' data-toggle='modal' data-cache='false' data-target='#uiModal' title='Quick View' >Some text</a>"
// 'expected' => "<a class='e-tip' href='myurl.php?id=3' data-toggle='modal' data-cache='false' data-target='#uiModal' title='Quick View' >Some text</a>" ),
// ), 2 => array(
// 2 => array( 'value' => 'Some text',
// 'value' => 'Some text', 'parms' => array('link'=>'url_001', 'target'=>'blank'),
// 'parms' => array('link'=>'url_001', 'target'=>'blank'), 'expected' => "<a class='e-tip' rel='external' href='https://e107.org' title='Quick View' >Some text</a>"
// 'expected' => "<a class='e-tip' rel='external' href='https://e107.org' title='Quick View' >Some text</a>" ),
// ), 3 => array(
// 3 => array( 'value' => 'Some text',
// 'value' => 'Some text', 'parms' => array('link'=>'myurl.php?country=[country_001]', 'target'=>'dialog'),
// 'parms' => array('link'=>'myurl.php?country=[country_001]', 'target'=>'dialog'), 'expected' => "<a class='e-tip e-modal' href='myurl.php?country=au' title='Quick View' >Some text</a>"
// 'expected' => "<a class='e-tip e-modal' href='myurl.php?country=au' title='Quick View' >Some text</a>" ),
// ), /* 4 => array(
// 4 => array( 'value' => 'Some text',
// 'value' => 'Some text', 'parms' => array('url'=>'rss', 'title'=>'Click Here'),
// 'parms' => array('url'=>'rss', 'title'=>'Click Here'), 'expected' => "<a class='e-tip' href='".e_HTTP."feed/rss-sefurl/rss/5' title='Click Here' >Some text</a>"
// 'expected' => "<a class='e-tip' href='".e_HTTP."feed/rss-sefurl/rss/5' title='Click Here' >Some text</a>" )*/
// )
// ); );
// try try
// { {
// /** @var e_admin_model $model */ /** @var e_admin_model $model */
// $model = $this->make('e_admin_model'); $model = $this->make('e_admin_model');
// } }
// catch (Exception $e) catch (Exception $e)
// { {
// $this->assertTrue(false, "Couldn't load e_admin_model object"); $this->assertTrue(false, "Couldn't load e_admin_model object");
// } }
// $model->setData($this->_values); $model->setData($this->_values);
// $model->setData('rss_url', 'rss-sefurl'); $model->setData('rss_url', 'rss-sefurl');
// $model->setData('rss_topicid', '5'); $model->setData('rss_topicid', '5');
// e107::setRegistry('core/adminUI/currentListModel', $model); e107::setRegistry('core/adminUI/currentListModel', $model);
// e107::setRegistry('core/adminUI/currentPlugin', 'rss_menu'); e107::setRegistry('core/adminUI/currentPlugin', 'rss_menu');
// foreach($tests as $t) foreach($tests as $t)
// { {
// $result = $this->_frm->renderLink($t['value'], $t['parms'], 3); $result = $this->_frm->renderLink($t['value'], $t['parms'], 3);
// $this->assertEquals($t['expected'],$result); $this->assertEquals($t['expected'],$result);
// } }

View File

@@ -84,10 +84,10 @@
'bootstrap3' => array ( 'bootstrap3' => array (
'templates' => array( // template key and string length 'templates' => array( // template key and string length
'jumbotron_home' => 2940, 'jumbotron_home' => 3132,
'modern_business_home' => 3746, 'modern_business_home' => 3842,
'jumbotron_full' => 1949, 'jumbotron_full' => 2239,
'jumbotron_sidebar_right' => 2765 'jumbotron_sidebar_right' => 2973
), ),
'menus' => array ( 'menus' => array (
'jumbotron_home' => array ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','100','101','102','103','104','105','106','107',), 'jumbotron_home' => array ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','100','101','102','103','104','105','106','107',),
@@ -100,8 +100,8 @@
'testkubrick' => array ( 'testkubrick' => array (
'templates' => array( 'templates' => array(
'legacyCustom' => 283, 'legacyCustom' => 267,
'legacyDefault' => 328 'legacyDefault' => 308
), ),
'menus' => array( 'menus' => array(
'legacyCustom' => array(), 'legacyCustom' => array(),
@@ -111,9 +111,9 @@
'testcore' => array ( 'testcore' => array (
'templates' => array ( 'templates' => array (
'HOME' => 1635, 'HOME' => 1494,
'FULL' => 1378, 'FULL' => 1269,
'legacyDefault'=> 1807 'legacyDefault'=> 1654
), ),
'menus' => array( 'menus' => array(
'HOME' => array('2', '3', '4'), 'HOME' => array('2', '3', '4'),
@@ -124,10 +124,10 @@
'basic-light' => array( 'basic-light' => array(
'templates' => array( 'templates' => array(
'default' => 3359, 'default' => 3274,
'default-home' => 3359, 'default-home' => 3274,
'simple-page' => 1604, 'simple-page' => 1553,
'wide-page' => 1272 'wide-page' => 1235
), ),
'menus' => array( 'menus' => array(
'default' => array('1', '2', '3', '4'), 'default' => array('1', '2', '3', '4'),
@@ -142,13 +142,16 @@
foreach($tests as $theme=>$vars) foreach($tests as $theme=>$vars)
{ {
$result = e_menu_layout::getLayouts($theme); $result = e_menu_layout::getLayouts($theme);
foreach($vars['templates'] as $key=>$length) foreach($vars['templates'] as $key=>$length)
{ {
$content = str_replace(array("\r", "\n"),'',$result['templates'][$key]);
$expectedLength = $length; $expectedLength = $length;
$actualLength = strlen($result['templates'][$key]); $actualLength = strlen($content);
//var_dump($key. " = ".$actualLength);
$this->assertEquals($expectedLength, $actualLength, $key. " is different"); $this->assertEquals($expectedLength, $actualLength, $key. " is different");
} }