From bd29c49f89f09be8bc6ebb264db8d11dc8f467d4 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 3 Sep 2019 05:07:06 -0700 Subject: [PATCH] Fixes --- tests/unit/e107tableTest.php | 2 ++ tests/unit/e_formTest.php | 8 +++---- tests/unit/e_parseTest.php | 13 +++++++++++- tests/unit/e_parse_shortcodeTest.php | 31 ++++++++++++++++++++++++---- tests/unit/xmlClassTest.php | 4 +++- 5 files changed, 48 insertions(+), 10 deletions(-) diff --git a/tests/unit/e107tableTest.php b/tests/unit/e107tableTest.php index ac121cd0c..c1dfa9f18 100644 --- a/tests/unit/e107tableTest.php +++ b/tests/unit/e107tableTest.php @@ -27,6 +27,8 @@ $this->assertTrue(false, "Couldn't load e107table object"); } + $this->ns->__construct(); + } /* public function testGetStyle() diff --git a/tests/unit/e_formTest.php b/tests/unit/e_formTest.php index 998f05116..4f7e74815 100644 --- a/tests/unit/e_formTest.php +++ b/tests/unit/e_formTest.php @@ -307,14 +307,14 @@ class e_formTest extends \Codeception\Test\Unit date_default_timezone_set('UTC'); $time = strtotime('January 1st, 2018 1am'); $actual = $this->_frm->datepicker('date_field',$time,'type=datetime&format=MM, dd, yyyy hh:ii'); - $expected = ""; + $expected = ""; $this->assertEquals($expected, $actual); // test timezone change... date_default_timezone_set('America/Los_Angeles'); $actual = $this->_frm->datepicker('date_field',$time,'type=datetime&format=MM, dd, yyyy hh:ii'); - $expected = ""; + $expected = ""; $this->assertEquals($expected, $actual); } @@ -940,8 +940,8 @@ class e_formTest extends \Codeception\Test\Unit // 'media_001' => '', // 'file_001' => '{e_MEDIA_FILE}test.zip', // 'files_001' => '{e_MEDIA_FILE}test.zip', - 'datestamp_001' => "", - 'date_001' => "", + 'datestamp_001' => "", + 'date_001' => "", 'userclass_001' => "", 'userclasses_001' => "", //todo check user_001 is correct diff --git a/tests/unit/e_parseTest.php b/tests/unit/e_parseTest.php index b8c14af2a..b4c25fb94 100644 --- a/tests/unit/e_parseTest.php +++ b/tests/unit/e_parseTest.php @@ -491,12 +491,23 @@ TMP; { } - +*/ public function testToText() { + $arr = array( + 0 => array('html'=>"

My Caption

", 'expected' => 'My Caption'), + 1 => array('html'=>"

My Caption

", 'expected' => 'My Caption'), + ); + + foreach($arr as $var) + { + $result = $this->tp->toText($var['html']); + $this->assertEquals($var['expected'],$result); } + } +/* public function testUstrtolower() { diff --git a/tests/unit/e_parse_shortcodeTest.php b/tests/unit/e_parse_shortcodeTest.php index c101a58ab..7dc928ebf 100644 --- a/tests/unit/e_parse_shortcodeTest.php +++ b/tests/unit/e_parse_shortcodeTest.php @@ -15,11 +15,14 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit public function _before() { - try { + try + { $this->scParser = $this->make('e_parse_shortcode'); - } catch (Exception $e) { + } + catch (Exception $e) { $this->fail("Couldn't create e_parse_shortcode object"); } + $this->scParser->__construct(); } @@ -59,12 +62,32 @@ class e_parse_shortcodeTest extends \Codeception\Test\Unit { } - +*/ public function testParseCodes() { + $text = '