diff options
author | David King <imkingdavid@gmail.com> | 2013-05-18 11:20:47 -0400 |
---|---|---|
committer | David King <imkingdavid@gmail.com> | 2013-05-18 11:20:47 -0400 |
commit | d8ed228ddf2f4117a5a8044e9903ef22febdeb4a (patch) | |
tree | 67621e4f166aab54861003b4500133a28e7b3fdd /tests/extension | |
parent | 367b3dac8c910e7877139d4631e63e44f4f843f0 (diff) | |
parent | 20815ed5a2032dbad628304d31a0c29b6eef3d4f (diff) | |
download | forums-d8ed228ddf2f4117a5a8044e9903ef22febdeb4a.tar forums-d8ed228ddf2f4117a5a8044e9903ef22febdeb4a.tar.gz forums-d8ed228ddf2f4117a5a8044e9903ef22febdeb4a.tar.bz2 forums-d8ed228ddf2f4117a5a8044e9903ef22febdeb4a.tar.xz forums-d8ed228ddf2f4117a5a8044e9903ef22febdeb4a.zip |
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
Diffstat (limited to 'tests/extension')
-rw-r--r-- | tests/extension/finder_test.php | 17 | ||||
-rw-r--r-- | tests/extension/manager_test.php | 6 | ||||
-rw-r--r-- | tests/extension/metadata_manager_test.php | 6 |
3 files changed, 25 insertions, 4 deletions
diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php index dc3e26be02..6f3cebbd7c 100644 --- a/tests/extension/finder_test.php +++ b/tests/extension/finder_test.php @@ -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 diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index c5b8237b82..a23e5a18d9 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -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__) . '/', diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php index 2f38a26217..d410333f09 100644 --- a/tests/extension/metadata_manager_test.php +++ b/tests/extension/metadata_manager_test.php @@ -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, |