[ticket/416] Improve portal module and modify tests
B3P-416
This commit is contained in:
@@ -666,12 +666,7 @@ class portal_module
|
||||
{
|
||||
if (confirm_box(true))
|
||||
{
|
||||
$sql = 'SELECT module_order, module_column, module_classname
|
||||
FROM ' . PORTAL_MODULES_TABLE . '
|
||||
WHERE module_id = ' . (int) $module_id;
|
||||
$result = $this->db->sql_query_limit($sql, 1);
|
||||
$module_data = $this->db->sql_fetchrow($result);
|
||||
$this->db->sql_freeresult($result);
|
||||
$module_data = $this->get_move_module_data($module_id);
|
||||
|
||||
if (!($this->c_class = $this->portal_helper->get_module($module_data['module_classname'])))
|
||||
{
|
||||
@@ -730,7 +725,7 @@ class portal_module
|
||||
*/
|
||||
public function get_move_module_data($module_id)
|
||||
{
|
||||
$sql = 'SELECT module_order, module_column, module_classname
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PORTAL_MODULES_TABLE . '
|
||||
WHERE module_id = ' . (int) $module_id;
|
||||
$result = $this->db->sql_query_limit($sql, 1);
|
||||
@@ -1048,12 +1043,7 @@ class portal_module
|
||||
*/
|
||||
protected function module_delete($id, $mode, $action, $module_id)
|
||||
{
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PORTAL_MODULES_TABLE . '
|
||||
WHERE module_id = ' . (int) $module_id;
|
||||
$result = $this->db->sql_query_limit($sql, 1);
|
||||
$module_data = $this->db->sql_fetchrow($result);
|
||||
$this->db->sql_freeresult($result);
|
||||
$module_data = $this->get_move_module_data($module_id);
|
||||
|
||||
if ($module_data !== false)
|
||||
{
|
||||
|
||||
@@ -87,9 +87,16 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
|
||||
{
|
||||
$module_data = $this->portal_module->get_move_module_data(1);
|
||||
$this->assertEquals(array(
|
||||
'module_order' => 1,
|
||||
'module_column' => 1,
|
||||
'module_order' => '1',
|
||||
'module_column' => '1',
|
||||
'module_classname' => '\board3\portal\modules\clock',
|
||||
'module_id' => '1',
|
||||
'module_name' => '',
|
||||
'module_image_src' => '',
|
||||
'module_image_width' => '0',
|
||||
'module_image_height' => '0',
|
||||
'module_group_ids' => '',
|
||||
'module_status' => '1',
|
||||
), $module_data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user