[ticket/555] Fix tests

B3P-555
This commit is contained in:
Marc Alexander
2015-06-03 13:36:21 +02:00
parent d3cca6a3e2
commit 530d841674
5 changed files with 41 additions and 13 deletions

View File

@@ -45,16 +45,22 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
->getMock());
// Mock module service collection
$config = new \phpbb\config\config(array());
$auth = $this->getMock('\phpbb\auth\auth', array('acl_get'));
$auth->expects($this->any())
->method('acl_get')
->with($this->anything())
->will($this->returnValue(true));
$controller_helper = new \board3\portal\tests\mock\controller_helper($phpbb_root_path, $phpEx);
$controller_helper->add_route('board3_portal_controller', 'portal');
$modules_helper = new \board3\portal\includes\modules_helper($auth, $config, $controller_helper, new \phpbb_mock_request);
$phpbb_container->set('board3.portal.module_collection',
array(
new \board3\portal\modules\clock($config, $template),
new \board3\portal\modules\birthday_list($config, $template, $this->db, $user),
new \board3\portal\modules\welcome($config, new \phpbb_mock_request, $this->db, $user, $phpbb_root_path, $phpEx),
new \board3\portal\modules\donation($config, $template, $user),
new \board3\portal\modules\donation($config, new \phpbb_mock_request, $template, $user, $modules_helper),
));
$this->portal_helper = new \board3\portal\includes\helper($phpbb_container->get('board3.portal.module_collection'));
$controller_helper = new \board3\portal\tests\mock\controller_helper($phpbb_root_path, $phpEx);
$controller_helper->add_route('board3_portal_controller', 'portal');
$phpbb_container->set('board3.portal.helper', $this->portal_helper);
$phpbb_container->set('board3.portal.modules_helper', new \board3\portal\includes\modules_helper(new \phpbb\auth\auth(), $config, $controller_helper, $request));
$phpbb_container->setParameter('board3.portal.modules.table', $table_prefix . 'portal_modules');
@@ -120,11 +126,6 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
'\board3\portal\modules\clock' => new \board3\portal\modules\clock($config, $template),
);
$portal_helper = new \board3\portal\includes\helper($modules);
$auth = $this->getMock('\phpbb\auth\auth', array('acl_get'));
$auth->expects($this->any())
->method('acl_get')
->with($this->anything())
->will($this->returnValue(true));
$controller_helper = new \board3\portal\controller\helper(
$auth,