diff --git a/tests/_data/testcore/theme.php b/tests/_data/testcore/theme.php index 323f996e8..f70aaa1d8 100644 --- a/tests/_data/testcore/theme.php +++ b/tests/_data/testcore/theme.php @@ -114,6 +114,9 @@ $FOOTER = ' </div> </div> '; + +$CUSTOMHEADER = array(); + $CUSTOMHEADER['HOME'] = ' <div class="wrapper"> <div class="headerbg"> diff --git a/tests/unit/e_formTest.php b/tests/unit/e_formTest.php index 7a22f41fa..a2ee58cd9 100644 --- a/tests/unit/e_formTest.php +++ b/tests/unit/e_formTest.php @@ -358,12 +358,24 @@ class e_formTest extends \Codeception\Test\Unit { } - +*/ public function testProgressBar() { + $tests = array( + 0 => array('value' => '10/20', 'expected' => 'width: 50%'), + 1 => array('value' => '4/5', 'expected' => 'width: 80%'), + 2 => array('value' => '150/300', 'expected' => 'width: 50%'), + 3 => array('value' => '30%', 'expected' => 'width: 30%'), + ); + + foreach($tests as $var) + { + $result = $this->_frm->progressBar('progress', $var['value']); + $this->assertContains($var['expected'],$result); + } } - +/* public function testTextarea() { diff --git a/tests/unit/e_parseTest.php b/tests/unit/e_parseTest.php index f7cdbc277..b8c14af2a 100644 --- a/tests/unit/e_parseTest.php +++ b/tests/unit/e_parseTest.php @@ -638,17 +638,18 @@ TMP; } $tests = array( - 0 => array('input'=> '{e_IMAGE}e107_icon_32.png', 'expected' => '/e107_images/e107_icon_32.png'), - 1 => array('input'=> '{e_MEDIA_IMAGE}icon_64.png', 'expected' => 'thumb.php?src=e_MEDIA_IMAGE'), - 2 => array('input'=> '{e_MEDIA_ICON}icon_64.png', 'expected' => '/e107_media/000000test/icons/icon_64.png'), - 3 => array('input'=> '{e_PLUGIN}gallery/images/gallery_32.png', 'expected' => '/e107_plugins/gallery/images/gallery_32.png'), + 0 => array('input'=> '{e_IMAGE}e107_icon_32.png', 'parms'=>null, 'expected' => '/e107_images/e107_icon_32.png'), + 1 => array('input'=> '{e_MEDIA_IMAGE}icon_64.png', 'parms'=>null, 'expected' => 'thumb.php?src=e_MEDIA_IMAGE'), + 2 => array('input'=> '{e_MEDIA_ICON}icon_64.png', 'parms'=>null, 'expected' => '/e107_media/000000test/icons/icon_64.png'), + 3 => array('input'=> '{e_PLUGIN}gallery/images/gallery_32.png', 'parms'=>null, 'expected' => '/e107_plugins/gallery/images/gallery_32.png'), + 4 => array('input'=> 'config_16.png', 'parms'=>array('legacy'=> "{e_IMAGE}icons/"), 'expected' => '/e107_images/icons/config_16.png'), ); foreach($tests as $var) { - $result = $this->tp->toIcon($var['input']); + $result = $this->tp->toIcon($var['input'],$var['parms']); $this->assertContains($var['expected'],$result); - // var_dump($var['expected']); + //var_dump($result); } } /*