mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Improved test for toIcon() and added progressBar test.
This commit is contained in:
@@ -114,6 +114,9 @@ $FOOTER = '
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
|
|
||||||
|
$CUSTOMHEADER = array();
|
||||||
|
|
||||||
$CUSTOMHEADER['HOME'] = '
|
$CUSTOMHEADER['HOME'] = '
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="headerbg">
|
<div class="headerbg">
|
||||||
|
@@ -358,12 +358,24 @@ class e_formTest extends \Codeception\Test\Unit
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
public function testProgressBar()
|
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()
|
public function testTextarea()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -638,17 +638,18 @@ TMP;
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tests = array(
|
$tests = array(
|
||||||
0 => array('input'=> '{e_IMAGE}e107_icon_32.png', 'expected' => '/e107_images/e107_icon_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', 'expected' => 'thumb.php?src=e_MEDIA_IMAGE'),
|
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', 'expected' => '/e107_media/000000test/icons/icon_64.png'),
|
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', 'expected' => '/e107_plugins/gallery/images/gallery_32.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)
|
foreach($tests as $var)
|
||||||
{
|
{
|
||||||
$result = $this->tp->toIcon($var['input']);
|
$result = $this->tp->toIcon($var['input'],$var['parms']);
|
||||||
$this->assertContains($var['expected'],$result);
|
$this->assertContains($var['expected'],$result);
|
||||||
// var_dump($var['expected']);
|
//var_dump($result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user