[ticket/216] Add method for checking if module can be moved

Also fixed minor issues with incorrect checks for module class 'custom'.

B3P-216
This commit is contained in:
Marc Alexander
2014-02-18 00:44:41 +01:00
parent 1d2bc15cf4
commit 4655544ed4
2 changed files with 86 additions and 52 deletions

View File

@@ -251,6 +251,27 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
$this->setExpectedTriggerError(E_USER_NOTICE, 'UNABLE_TO_MOVE');
$this->portal_module->move_module_left($module_id);
}
public function data_can_move_module()
{
return array(
array(false, 'left', '\board3\portal\modules\clock'),
array(false, 'right', '\board3\portal\modules\clock'),
array(true, 'center', '\board3\portal\modules\clock'),
array(true, array('top', 'bottom', 'center'), '\board3\portal\modules\clock'),
array(false, array('left', 'right'), '\board3\portal\modules\clock'),
array(false, 'center', '\board3\portal\modules\birthday_list'),
);
}
/**
* @dataProvider data_can_move_module
*/
public function test_can_move_module($expected, $target_column, $module_class)
{
$this->update_portal_modules();
$this->assertEquals($expected, $this->portal_module->can_move_module($target_column, $module_class));
}
}
function redirect($url)