mirror of
https://github.com/e107inc/e107.git
synced 2025-04-05 05:02:44 +02:00
added tests for uc_select
This commit is contained in:
parent
2301c4a042
commit
deb544f2cf
@ -92,10 +92,11 @@
|
||||
try
|
||||
{
|
||||
$this->_frm = $this->make('e_form');
|
||||
$this->_frm->__construct();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$this->assertTrue(false, "Couldn't load e_parser object");
|
||||
$this->assertTrue(false, "Couldn't load e_form object");
|
||||
}
|
||||
}
|
||||
|
||||
@ -402,22 +403,73 @@
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testUc_select()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function test_uc_select_cb()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testOptgroup_open()
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
public function testUc_select_single_numeric()
|
||||
{
|
||||
$uc_options = 'admin';
|
||||
$select_options = array('multiple' => false);
|
||||
$opt_options = array();
|
||||
$actual = $this->_frm->uc_select('uc', 254, $uc_options, $select_options, $opt_options);
|
||||
$expected = "<select name='uc' id='uc' class='tbox select form-control'>\n<option value='254' selected='selected'> Admin</option>\n\n<optgroup label=\"Everyone but..\">\n<option value='-254'> Not Admin</option>\n</optgroup>\n\n</select>";
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
|
||||
public function testUc_select_single_string()
|
||||
{
|
||||
$uc_options = 'admin';
|
||||
$select_options = array('multiple' => false);
|
||||
$opt_options = array();
|
||||
$actual = $this->_frm->uc_select('uc', 'Admin', $uc_options, $select_options, $opt_options);
|
||||
$expected = "<select name='uc' id='uc' class='tbox select form-control'>\n<option value='254' selected='selected'> Admin</option>\n\n<optgroup label=\"Everyone but..\">\n<option value='-254'> Not Admin</option>\n</optgroup>\n\n</select>";
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
|
||||
public function testUc_select_multi_numeric()
|
||||
{
|
||||
$uc_options = 'member,admin';
|
||||
$select_options = array('multiple' => true);
|
||||
$opt_options = array();
|
||||
$actual = $this->_frm->uc_select('uc', '254,253', $uc_options, $select_options, $opt_options);
|
||||
$expected = "<select name='uc[]' id='uc' class='tbox select form-control' multiple='multiple'>\n<option value='254' selected='selected'> Admin</option>\n<option value='253' selected='selected'> Members</option>\n\n<optgroup label=\"Everyone but..\">\n<option value='-254'> Not Admin</option>\n<option value='-253'> Not Members</option>\n</optgroup>\n\n</select>";
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
|
||||
public function testUc_select_multi_string()
|
||||
{
|
||||
$uc_options = 'member,admin';
|
||||
$select_options = array('multiple' => true);
|
||||
$opt_options = array();
|
||||
$actual = $this->_frm->uc_select('uc', 'Admin,Members', $uc_options, $select_options, $opt_options);
|
||||
$expected = "<select name='uc[]' id='uc' class='tbox select form-control' multiple='multiple'>\n<option value='254' selected='selected'> Admin</option>\n<option value='253' selected='selected'> Members</option>\n\n<optgroup label=\"Everyone but..\">\n<option value='-254'> Not Admin</option>\n<option value='-253'> Not Members</option>\n</optgroup>\n\n</select>";
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
|
||||
public function testUc_select_multi_mixed()
|
||||
{
|
||||
$uc_options = 'member,admin';
|
||||
$select_options = array('multiple' => true);
|
||||
$opt_options = array();
|
||||
$actual = $this->_frm->uc_select('uc', 'Admin,253', $uc_options, $select_options, $opt_options);
|
||||
$expected = "<select name='uc[]' id='uc' class='tbox select form-control' multiple='multiple'>\n<option value='254' selected='selected'> Admin</option>\n<option value='253' selected='selected'> Members</option>\n\n<optgroup label=\"Everyone but..\">\n<option value='-254'> Not Admin</option>\n<option value='-253'> Not Members</option>\n</optgroup>\n\n</select>";
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
|
||||
/*
|
||||
public function test_uc_select_cb()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testOptgroup_open()
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
public function testOption()
|
||||
{
|
||||
$options = array('disabled'=>true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user