1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-25 14:59:49 +01:00

Improved test for toIcon() and added progressBar test.

This commit is contained in:
Cameron 2019-05-01 10:07:35 -07:00
parent 423f6b2cd6
commit ddefcc9645
3 changed files with 24 additions and 8 deletions

View File

@ -114,6 +114,9 @@ $FOOTER = '
</div>
</div>
';
$CUSTOMHEADER = array();
$CUSTOMHEADER['HOME'] = '
<div class="wrapper">
<div class="headerbg">

View File

@ -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()
{

View File

@ -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);
}
}
/*