mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge branch '3.3.x'
This commit is contained in:
@@ -83,6 +83,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
||||
$this->db,
|
||||
$this->config,
|
||||
$finder_factory,
|
||||
new phpbb_mock_dummy_router(),
|
||||
'phpbb_ext',
|
||||
__DIR__ . '/../../phpBB/',
|
||||
null
|
||||
|
@@ -30,6 +30,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->db = null;
|
||||
$this->extension_manager = $this->create_extension_manager();
|
||||
}
|
||||
|
||||
@@ -95,7 +96,12 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||
|
||||
$this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
|
||||
$this->extension_manager->enable('vendor2/bar');
|
||||
$this->assertEquals(array('vendor2/bar', 'vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
|
||||
|
||||
// We should not display the extension as being enabled in the same request
|
||||
$this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
|
||||
// With a different request we should see the extension as being disabled
|
||||
$this->assertEquals(array('vendor2/bar', 'vendor2/foo'), array_keys($this->create_extension_manager()->all_enabled()));
|
||||
|
||||
$this->assertEquals(array('vendor/moo', 'vendor2/bar', 'vendor2/foo'), array_keys($this->extension_manager->all_configured()));
|
||||
|
||||
$this->assertEquals(4, vendor2\bar\ext::$state);
|
||||
@@ -119,7 +125,12 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||
|
||||
$this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
|
||||
$this->extension_manager->disable('vendor2/foo');
|
||||
$this->assertEquals(array(), array_keys($this->extension_manager->all_enabled()));
|
||||
|
||||
// We should still display the extension as being enabled in the current request
|
||||
$this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
|
||||
// With a different request we should see the extension as being disabled
|
||||
$this->assertEquals(array(), array_keys($this->create_extension_manager()->all_enabled()));
|
||||
|
||||
$this->assertEquals(array('vendor/moo', 'vendor2/foo'), array_keys($this->extension_manager->all_configured()));
|
||||
|
||||
$this->assertTrue(vendor2\foo\ext::$disabled);
|
||||
@@ -179,6 +190,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||
$db,
|
||||
$config,
|
||||
$finder_factory,
|
||||
new phpbb_mock_dummy_router(),
|
||||
'phpbb_ext',
|
||||
__DIR__ . '/',
|
||||
($with_cache) ? new \phpbb\cache\service(new phpbb_mock_cache(), $config, $db, $phpbb_root_path, $php_ext) : null
|
||||
|
@@ -99,6 +99,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
|
||||
$this->db,
|
||||
$this->config,
|
||||
$finder_factory,
|
||||
new phpbb_mock_dummy_router(),
|
||||
'phpbb_ext',
|
||||
$this->phpbb_root_path,
|
||||
$this->cache
|
||||
|
31
tests/mock/dummy_router.php
Normal file
31
tests/mock/dummy_router.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
class phpbb_mock_dummy_router extends phpbb_mock_router
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function get_matcher()
|
||||
{
|
||||
$this->create_new_url_matcher();
|
||||
return parent::get_matcher();
|
||||
}
|
||||
|
||||
public function get_generator()
|
||||
{
|
||||
$this->create_new_url_generator();
|
||||
return parent::get_generator();
|
||||
}
|
||||
}
|
@@ -11,6 +11,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class phpbb_mock_extension_manager extends \phpbb\extension\manager
|
||||
{
|
||||
public function __construct($phpbb_root_path, $extensions = array(), $container = null)
|
||||
@@ -20,10 +21,9 @@ class phpbb_mock_extension_manager extends \phpbb\extension\manager
|
||||
$lang = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->extensions = $extensions;
|
||||
$this->filesystem = new \phpbb\filesystem\filesystem();
|
||||
$this->container = $container;
|
||||
$this->config = new \phpbb\config\config(array());
|
||||
$this->user = new \phpbb\user($lang,'\phpbb\datetime');
|
||||
$this->finder_factory = new \phpbb\finder\factory(null, false, $this->phpbb_root_path, $phpEx);
|
||||
$this->router = new phpbb_mock_dummy_router();
|
||||
}
|
||||
}
|
||||
|
@@ -264,6 +264,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
$db,
|
||||
$config,
|
||||
$finder_factory,
|
||||
new phpbb_mock_dummy_router(),
|
||||
self::$config['table_prefix'] . 'ext',
|
||||
__DIR__ . '/',
|
||||
new \phpbb\cache\service($this->get_cache_driver(), $config, $this->db, $phpbb_root_path, $phpEx)
|
||||
|
Reference in New Issue
Block a user