createXMLDataSet(dirname(__FILE__) . '/fixtures/auth.xml');
}
public function setUp()
{
parent::setUp();
$auth = new \phpbb\auth\auth();
$this->modules_helper = new \board3\portal\includes\modules_helper($auth);
}
public function data_get_disallowed_forums()
{
return array(
array(array(), false),
array(array(0 => 1, 1 => 2), true),
);
}
/**
* @dataProvider data_get_disallowed_forums
*/
public function test_get_disallowed_forums($expected, $input)
{
$this->assertEquals($expected, $this->modules_helper->get_disallowed_forums($input));
}
public function data_generate_select_box()
{
return array(
array('',
'foobar',
array(
'1' => array(
'value' => 'one',
'title' => 'one',
),
'2' => array(
'value' => 'two',
'title' => 'two',
),
),
array('two')),
array('',
'foobar',
array(
'1' => array(
'value' => 'one',
'title' => 'two',
),
'2' => array(
'value' => 'two',
'title' => 'three',
),
),
array('one')),
);
}
/**
* @dataProvider data_generate_select_box
*/
public function test_generate_select_box($expected, $key, $select_ary, $selected_options)
{
$this->assertEquals($expected, $this->modules_helper->generate_select_box($key, $select_ary, $selected_options));
}
}