1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge remote-tracking branch 'EXreaction/ticket/11415' into develop

* EXreaction/ticket/11415:
  [ticket/11415] Add test for find_from_extension()
  [ticket/11415] Send the extension base the finder rather than the manager
  [ticket/11415] Create function in finder find_from_extension
  [ticket/11415] Fix ext.manager constructor in tests
  [ticket/11415] Make migrator/ext.manager dependencies of the base ext class
  [ticket/11415] Remove migrator dependency from extension manager
  [ticket/11415] Move migrator to base extension class from ext.manager
  [ticket/11415] Move while loop from ext manager to acp_extensions.php
This commit is contained in:
David King
2013-05-18 11:20:47 -04:00
10 changed files with 172 additions and 112 deletions

View File

@@ -158,6 +158,23 @@ class phpbb_extension_finder_test extends phpbb_test_case
);
}
public function test_find_from_extension()
{
$files = $this->finder
->extension_directory('/type')
->find_from_extension('foo', dirname(__FILE__) . '/ext/foo/');
$classes = $this->finder->get_classes_from_files($files);
sort($classes);
$this->assertEquals(
array(
'phpbb_ext_foo_type_alternative',
'phpbb_ext_foo_type_dummy_empty',
),
$classes
);
}
/**
* These do not work because of changes with PHPBB3-11386
* They do not seem neccessary to me, so I am commenting them out for now

View File

@@ -107,11 +107,13 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$table_prefix,
array()
);
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
return new phpbb_extension_manager(
new phpbb_mock_container_builder(),
$container,
$db,
$config,
$migrator,
new phpbb_filesystem(),
'phpbb_ext',
dirname(__FILE__) . '/',

View File

@@ -61,11 +61,13 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->table_prefix,
array()
);
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
$this->extension_manager = new phpbb_extension_manager(
new phpbb_mock_container_builder(),
$container,
$this->db,
$this->config,
$this->migrator,
new phpbb_filesystem(),
'phpbb_ext',
$this->phpbb_root_path,