1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Merge branch 'ticket/15392' into ticket/15392-master

This commit is contained in:
Marc Alexander
2021-03-04 17:04:17 +01:00
211 changed files with 395 additions and 396 deletions

View File

@@ -10,9 +10,9 @@
* the docs/CREDITS.txt file.
*
*/
require_once dirname(__FILE__) . '/ext/vendor2/bar/migrations/bar.php';
require_once dirname(__FILE__) . '/ext/vendor2/bar/migrations/foo.php';
require_once dirname(__FILE__) . '/ext/vendor2/bar/migrations/migration.php';
require_once __DIR__ . '/ext/vendor2/bar/migrations/bar.php';
require_once __DIR__ . '/ext/vendor2/bar/migrations/foo.php';
require_once __DIR__ . '/ext/vendor2/bar/migrations/migration.php';
class phpbb_extension_extension_base_test extends phpbb_test_case
{
@@ -37,7 +37,7 @@ class phpbb_extension_extension_base_test extends phpbb_test_case
$container->set('migrator', $migrator);
$this->extension_manager = new phpbb_mock_extension_manager(
dirname(__FILE__) . '/',
__DIR__ . '/',
array(
'vendor2/foo' => array(
'ext_name' => 'vendor2/foo',

View File

@@ -21,7 +21,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
protected function setUp(): void
{
$this->extension_manager = new phpbb_mock_extension_manager(
dirname(__FILE__) . '/',
__DIR__ . '/',
array(
'vendor2/foo' => array(
'ext_name' => 'vendor2/foo',
@@ -106,7 +106,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
sort($dirs);
$this->assertEquals(array(
dirname(__FILE__) . '/ext/vendor2/foo/type/',
__DIR__ . '/ext/vendor2/foo/type/',
), $dirs);
}
@@ -118,9 +118,9 @@ class phpbb_extension_finder_test extends phpbb_test_case
sort($dirs);
$this->assertEquals(array(
dirname(__FILE__) . '/ext/vendor2/foo/sub/type/',
dirname(__FILE__) . '/ext/vendor2/foo/type/',
dirname(__FILE__) . '/ext/vendor2/foo/typewrong/',
__DIR__ . '/ext/vendor2/foo/sub/type/',
__DIR__ . '/ext/vendor2/foo/type/',
__DIR__ . '/ext/vendor2/foo/typewrong/',
), $dirs);
}
@@ -224,7 +224,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
{
$files = $this->finder
->extension_directory('/type')
->find_from_extension('vendor2/foo', dirname(__FILE__) . '/ext/vendor2/foo/');
->find_from_extension('vendor2/foo', __DIR__ . '/ext/vendor2/foo/');
$classes = $this->finder->get_classes_from_files($files);
sort($classes);
@@ -243,7 +243,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
public function test_get_classes_create_cache()
{
$cache = new phpbb_mock_cache;
$finder = new \phpbb\finder(dirname(__FILE__) . '/', $cache, 'php', '_custom_cache_name');
$finder = new \phpbb\finder(__DIR__ . '/', $cache, 'php', '_custom_cache_name');
$finder->set_extensions(array_keys($this->extension_manager->all_enabled()));
$files = $finder->suffix('_class.php')->get_files();
@@ -283,7 +283,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
);
$finder = new \phpbb\finder(
dirname(__FILE__) . '/',
__DIR__ . '/',
new phpbb_mock_cache(array(
'_ext_finder' => array(
md5(serialize($query)) => array('file_name' => 'extension'),
@@ -299,7 +299,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
sort($classes);
$this->assertEquals(
array(dirname(__FILE__) . '/file_name'),
array(__DIR__ . '/file_name'),
$classes
);
}

View File

@@ -11,10 +11,10 @@
*
*/
require_once dirname(__FILE__) . '/ext/vendor2/bar/ext.php';
require_once dirname(__FILE__) . '/ext/vendor2/foo/ext.php';
require_once dirname(__FILE__) . '/ext/vendor3/foo/ext.php';
require_once dirname(__FILE__) . '/ext/vendor/moo/ext.php';
require_once __DIR__ . '/ext/vendor2/bar/ext.php';
require_once __DIR__ . '/ext/vendor2/foo/ext.php';
require_once __DIR__ . '/ext/vendor3/foo/ext.php';
require_once __DIR__ . '/ext/vendor/moo/ext.php';
class phpbb_extension_manager_test extends phpbb_database_test_case
{
@@ -23,7 +23,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
public function getDataSet()
{
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml');
return $this->createXMLDataSet(__DIR__ . '/fixtures/extensions.xml');
}
protected function setUp(): void
@@ -178,7 +178,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$db,
$config,
'phpbb_ext',
dirname(__FILE__) . '/',
__DIR__ . '/',
$php_ext,
($with_cache) ? new \phpbb\cache\service(new phpbb_mock_cache(), $config, $db, $phpbb_root_path, $php_ext) : null
);

View File

@@ -29,7 +29,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
public function getDataSet()
{
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml');
return $this->createXMLDataSet(__DIR__ . '/fixtures/extensions.xml');
}
protected function setUp(): void
@@ -42,7 +42,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->db = $this->new_dbal();
$factory = new \phpbb\db\tools\factory();
$this->db_tools = $factory->get($this->db);
$this->phpbb_root_path = dirname(__FILE__) . '/';
$this->phpbb_root_path = __DIR__ . '/';
$this->phpEx = 'php';
$this->cache = new \phpbb\cache\service(new phpbb_mock_cache(), $this->config, $this->db, $this->phpbb_root_path, $this->phpEx);

View File

@@ -11,12 +11,12 @@
*
*/
require_once dirname(__FILE__) . '/ext/vendor2/foo/acp/a_info.php';
require_once dirname(__FILE__) . '/ext/vendor2/foo/mcp/a_info.php';
require_once dirname(__FILE__) . '/ext/vendor2/foo/acp/fail_info.php';
require_once dirname(__FILE__) . '/ext/vendor2/bar/acp/a_info.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/acp/acp_modules.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_module.php';
require_once __DIR__ . '/ext/vendor2/foo/acp/a_info.php';
require_once __DIR__ . '/ext/vendor2/foo/mcp/a_info.php';
require_once __DIR__ . '/ext/vendor2/foo/acp/fail_info.php';
require_once __DIR__ . '/ext/vendor2/bar/acp/a_info.php';
require_once __DIR__ . '/../../phpBB/includes/acp/acp_modules.php';
require_once __DIR__ . '/../../phpBB/includes/functions_module.php';
class phpbb_extension_modules_test extends phpbb_test_case
{
@@ -29,7 +29,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
global $phpbb_extension_manager;
$this->extension_manager = new phpbb_mock_extension_manager(
dirname(__FILE__) . '/',
__DIR__ . '/',
array(
'vendor2/foo' => array(
'ext_name' => 'vendor2/foo',
@@ -49,7 +49,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
$this->createMock('\phpbb\db\driver\driver_interface'),
$this->extension_manager,
MODULES_TABLE,
dirname(__FILE__) . '/',
__DIR__ . '/',
'php'
);
}
@@ -61,7 +61,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
// $this->markTestIncomplete('Modules no speak namespace! Going to get rid of db modules altogether and fix this test after.');
// Correctly set the root path for this test to this directory, so the classes can be found
$phpbb_root_path = dirname(__FILE__) . '/';
$phpbb_root_path = __DIR__ . '/';
// Find acp module info files
$acp_modules = $this->module_manager->get_module_infos('acp');
@@ -193,7 +193,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
global $phpbb_extension_manager, $phpbb_dispatcher;
$phpbb_extension_manager = $this->extension_manager = new phpbb_mock_extension_manager(
dirname(__FILE__) . '/',
__DIR__ . '/',
array(
'vendor2/foo' => array(
'ext_name' => 'vendor2/foo',