[ticket/469] Fix tests with new settings
B3P-469
This commit is contained in:
@@ -104,7 +104,7 @@ class portal_module
|
|||||||
|
|
||||||
'legend3' => 'ACP_PORTAL_SHOW_ALL',
|
'legend3' => 'ACP_PORTAL_SHOW_ALL',
|
||||||
'board3_show_all_pages' => array('lang' => 'ACP_PORTAL_SHOW_ALL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'board3_show_all_pages' => array('lang' => 'ACP_PORTAL_SHOW_ALL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'board3_show_all_side' => array('lang' => 'PORTAL_SHOW_ALL_SIDE', 'validate' => 'bool', 'type' => 'custom', 'method' => array('board3.portal.modules_helper', 'display_left_right'), 'explain' => true),
|
'board3_show_all_side' => array('lang' => 'PORTAL_SHOW_ALL_SIDE', 'validate' => 'bool', 'type' => 'custom', 'method' => array('board3.portal.modules_helper', 'display_left_right'), 'submit' => array('board3.portal.modules_helper', 'store_left_right'), 'explain' => true),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -223,11 +223,11 @@ class portal_module
|
|||||||
if ($null['submit'][0] == 'board3.portal.modules_helper')
|
if ($null['submit'][0] == 'board3.portal.modules_helper')
|
||||||
{
|
{
|
||||||
$func = array($this->modules_helper, $null['submit'][1]);
|
$func = array($this->modules_helper, $null['submit'][1]);
|
||||||
$args = ($module_id != 0) ? array($config_name, $module_id) : $config_name;
|
$args = ($module_id != 0) ? array($config_name, $module_id) : array($config_name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$args = ($module_id != 0) ? array($cfg_array[$config_name], $config_name, $module_id) : $config_name;
|
$args = ($module_id != 0) ? array($cfg_array[$config_name], $config_name, $module_id) : array($config_name);
|
||||||
$func = $null['submit'];
|
$func = $null['submit'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,4 +173,17 @@ class modules_helper
|
|||||||
|
|
||||||
return h_radio($key, $radio_ary, $value, $key);
|
return h_radio($key, $radio_ary, $value, $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store left right choice
|
||||||
|
*
|
||||||
|
* @param string $key Config key
|
||||||
|
*/
|
||||||
|
public function store_left_right($key)
|
||||||
|
{
|
||||||
|
// Get selected side
|
||||||
|
$value = $this->request->variable($key, false);
|
||||||
|
|
||||||
|
$this->config->set($key, $value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ class listener_test extends \phpbb_template_template_test_case
|
|||||||
protected $listener;
|
protected $listener;
|
||||||
protected $auth;
|
protected $auth;
|
||||||
|
|
||||||
|
/** @var \board3\portal\controller\main */
|
||||||
|
protected $controller;
|
||||||
|
|
||||||
static public $hidden_fields = array();
|
static public $hidden_fields = array();
|
||||||
|
|
||||||
public function setup()
|
public function setup()
|
||||||
@@ -91,7 +94,12 @@ class listener_test extends \phpbb_template_template_test_case
|
|||||||
$this->auth->acl_options['global']['u_view_portal'] = 0;
|
$this->auth->acl_options['global']['u_view_portal'] = 0;
|
||||||
$this->auth->acl[0][0] = true;
|
$this->auth->acl[0][0] = true;
|
||||||
|
|
||||||
|
$this->controller = $this->getMockBuilder('\board3\portal\controller\main')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
|
||||||
$this->listener = new \board3\portal\event\listener(
|
$this->listener = new \board3\portal\event\listener(
|
||||||
|
$this->controller,
|
||||||
$this->auth,
|
$this->auth,
|
||||||
$this->config,
|
$this->config,
|
||||||
$this->controller_helper,
|
$this->controller_helper,
|
||||||
|
|||||||
Reference in New Issue
Block a user