Skip to content

Commit 68f5aea

Browse files
committed
Fix tests
1 parent 5f9f323 commit 68f5aea

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

tests/ext_test.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010

1111
namespace phpbb\teamsecurity\tests;
1212

13+
require_once __DIR__ . '/../ext.php';
14+
1315
class ext_test extends \phpbb_database_test_case
1416
{
1517
protected const TEAM_SECURITY = 'phpbb/teamsecurity';
1618
protected $extension_manager;
19+
protected $class_loader;
1720

1821
public function getDataSet()
1922
{
@@ -24,7 +27,6 @@ protected function setUp(): void
2427
{
2528
parent::setUp();
2629

27-
$this->db = null;
2830
$this->extension_manager = $this->create_extension_manager();
2931
}
3032

@@ -53,16 +55,20 @@ public function test_disable()
5355

5456
protected function create_extension_manager()
5557
{
56-
global $phpbb_root_path, $php_ext;
58+
$phpbb_root_path = __DIR__ . './../../../../';
59+
$php_ext = 'php';
5760

5861
$config = new \phpbb\config\config(['version' => PHPBB_VERSION]);
5962
$db = $this->new_dbal();
63+
$db_doctrine = $this->new_doctrine_dbal();
6064
$phpbb_dispatcher = new \phpbb_mock_event_dispatcher();
6165
$factory = new \phpbb\db\tools\factory();
62-
$db_tools = $factory->get($db);
66+
$finder_factory = new \phpbb\finder\factory(null, false, $phpbb_root_path, $php_ext);
67+
$db_tools = $factory->get($db_doctrine);
6368
$table_prefix = 'phpbb_';
6469

6570
$container = new \phpbb_mock_container_builder();
71+
$container->set('event_dispatcher', $phpbb_dispatcher);
6672

6773
$migrator = new \phpbb\db\migrator(
6874
$container,
@@ -73,20 +79,19 @@ protected function create_extension_manager()
7379
$phpbb_root_path,
7480
$php_ext,
7581
$table_prefix,
82+
self::get_core_tables(),
7683
[],
7784
new \phpbb\db\migration\helper()
7885
);
7986
$container->set('migrator', $migrator);
80-
$container->set('dispatcher', $phpbb_dispatcher);
8187

8288
return new \phpbb\extension\manager(
8389
$container,
8490
$db,
8591
$config,
86-
new \phpbb\filesystem\filesystem(),
92+
$finder_factory,
8793
'phpbb_ext',
8894
$phpbb_root_path,
89-
$php_ext,
9095
null
9196
);
9297
}

0 commit comments

Comments
 (0)