[ticket/528] Add missing dependencies to tests

B3P-528
This commit is contained in:
Marc Alexander
2015-04-27 16:48:21 +02:00
parent d699ef0e3b
commit 9d0146918d
3 changed files with 76 additions and 6 deletions

View File

@@ -90,9 +90,6 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
)); ));
$this->database_handler = new \board3\portal\portal\modules\database_handler($db); $this->database_handler = new \board3\portal\portal\modules\database_handler($db);
$this->constraints_handler = new \board3\portal\portal\modules\constraints_handler($this->portal_columns, $user); $this->constraints_handler = new \board3\portal\portal\modules\constraints_handler($this->portal_columns, $user);
$this->modules_manager = new \board3\portal\portal\modules\manager($cache, $db, $this->portal_columns, $this->portal_helper, $this->constraints_handler, $this->database_handler, $request, $user);
$phpbb_container->set('board3.portal.modules.manager', $this->modules_manager);
$phpbb_container->set('board3.portal.modules.constraints_handler', $this->constraints_handler);
$path_helper = new \phpbb\path_helper( $path_helper = new \phpbb\path_helper(
new \phpbb\symfony_request( new \phpbb\symfony_request(
@@ -104,6 +101,21 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
$phpEx $phpEx
); );
$b3p_controller_helper = new \board3\portal\controller\helper(
new \phpbb\auth\auth(),
$this->portal_columns,
$config,
$template,
$user,
$path_helper,
$this->portal_helper,
$phpbb_root_path,
$phpEx
);
$this->modules_manager = new \board3\portal\portal\modules\manager($cache, $db, $b3p_controller_helper, $this->portal_columns, $this->portal_helper, $this->constraints_handler, $this->database_handler, $request, $user);
$phpbb_container->set('board3.portal.modules.manager', $this->modules_manager);
$phpbb_container->set('board3.portal.modules.constraints_handler', $this->constraints_handler);
$modules = array( $modules = array(
'\board3\portal\modules\clock' => new \board3\portal\modules\clock($config, $template), '\board3\portal\modules\clock' => new \board3\portal\modules\clock($config, $template),
); );

View File

@@ -26,6 +26,12 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor
/** @var \board3\portal\portal\modules\constraints_handler */ /** @var \board3\portal\portal\modules\constraints_handler */
protected $constraints_handler; protected $constraints_handler;
/** @var \phpbb\path_helper */
protected $path_helper;
/** @var \board3\portal\controller\helper */
protected $b3p_controller_helper;
public function getDataSet() public function getDataSet()
{ {
return $this->createXMLDataSet(dirname(__FILE__) . '/../acp/fixtures/modules.xml'); return $this->createXMLDataSet(dirname(__FILE__) . '/../acp/fixtures/modules.xml');
@@ -78,7 +84,30 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor
$this->database_handler = new \board3\portal\portal\modules\database_handler($db); $this->database_handler = new \board3\portal\portal\modules\database_handler($db);
$this->constraints_handler = new \board3\portal\portal\modules\constraints_handler($this->portal_columns, $user); $this->constraints_handler = new \board3\portal\portal\modules\constraints_handler($this->portal_columns, $user);
$this->modules_manager = new \board3\portal\portal\modules\manager($this->cache, $db, $this->portal_columns, $this->portal_helper, $this->constraints_handler, $this->database_handler, $request, $user);
$this->path_helper = new \phpbb\path_helper(
new \phpbb\symfony_request(
new \phpbb_mock_request()
),
new \phpbb\filesystem(),
new \phpbb_mock_request(),
$phpbb_root_path,
$phpEx
);
$this->b3p_controller_helper = new \board3\portal\controller\helper(
new \phpbb\auth\auth(),
$this->portal_columns,
$config,
new \board3\portal\tests\mock\template($this),
$user,
$this->path_helper,
$this->portal_helper,
$phpbb_root_path,
$phpEx
);
$this->modules_manager = new \board3\portal\portal\modules\manager($this->cache, $db, $this->b3p_controller_helper, $this->portal_columns, $this->portal_helper, $this->constraints_handler, $this->database_handler, $request, $user);
$portal_config = array(); $portal_config = array();
} }
@@ -126,7 +155,7 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor
$this->cache->expects($this->any()) $this->cache->expects($this->any())
->method('purge'); ->method('purge');
$this->request->overwrite('module_classname', '\board3\portal\modules\donation'); $this->request->overwrite('module_classname', '\board3\portal\modules\donation');
$this->modules_manager = new \board3\portal\portal\modules\manager($this->cache, $this->db, $this->portal_columns, $this->portal_helper, $this->constraints_handler, $this->database_handler, $this->request, $this->user); $this->modules_manager = new \board3\portal\portal\modules\manager($this->cache, $this->db, $this->b3p_controller_helper, $this->portal_columns, $this->portal_helper, $this->constraints_handler, $this->database_handler, $this->request, $this->user);
$this->modules_manager->set_u_action('adm/index.php?i=15&mode=foobar')->set_acp_class('foo\bar'); $this->modules_manager->set_u_action('adm/index.php?i=15&mode=foobar')->set_acp_class('foo\bar');
// Trigger confirm box creation // Trigger confirm box creation

View File

@@ -20,6 +20,12 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew
/** @var \board3\portal\portal\modules\constraints_handler */ /** @var \board3\portal\portal\modules\constraints_handler */
protected $constraints_handler; protected $constraints_handler;
/** @var \phpbb\path_helper */
protected $path_helper;
/** @var \board3\portal\controller\helper */
protected $b3p_controller_helper;
public function getDataSet() public function getDataSet()
{ {
return $this->createXMLDataSet(dirname(__FILE__) . '/../acp/fixtures/modules.xml'); return $this->createXMLDataSet(dirname(__FILE__) . '/../acp/fixtures/modules.xml');
@@ -73,7 +79,30 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew
)); ));
$this->database_handler = new \board3\portal\portal\modules\database_handler($db); $this->database_handler = new \board3\portal\portal\modules\database_handler($db);
$this->constraints_handler = new \board3\portal\portal\modules\constraints_handler($this->portal_columns, $user); $this->constraints_handler = new \board3\portal\portal\modules\constraints_handler($this->portal_columns, $user);
$this->modules_manager = new \board3\portal\portal\modules\manager($cache, $db, $this->portal_columns, $portal_helper, $this->constraints_handler, $this->database_handler, $request, $user);
$this->path_helper = new \phpbb\path_helper(
new \phpbb\symfony_request(
new \phpbb_mock_request()
),
new \phpbb\filesystem(),
new \phpbb_mock_request(),
$phpbb_root_path,
$phpEx
);
$this->b3p_controller_helper = new \board3\portal\controller\helper(
new \phpbb\auth\auth(),
$this->portal_columns,
$config,
new \board3\portal\tests\mock\template($this),
$user,
$this->path_helper,
$this->portal_helper,
$phpbb_root_path,
$phpEx
);
$this->modules_manager = new \board3\portal\portal\modules\manager($cache, $db, $this->b3p_controller_helper, $this->portal_columns, $portal_helper, $this->constraints_handler, $this->database_handler, $request, $user);
$portal_modules = obtain_portal_modules(); $portal_modules = obtain_portal_modules();
foreach($portal_modules as $cur_module) foreach($portal_modules as $cur_module)
{ {