aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extension
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extension')
-rw-r--r--tests/extension/finder_test.php26
-rw-r--r--tests/extension/includes/acp/acp_foobar.php13
-rw-r--r--tests/extension/includes/acp/info/acp_foobar.php13
-rw-r--r--tests/extension/manager_test.php12
-rw-r--r--tests/extension/metadata_manager_test.php34
-rw-r--r--tests/extension/modules_test.php10
6 files changed, 73 insertions, 35 deletions
diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php
index d0ca5956b4..8cc5146b33 100644
--- a/tests/extension/finder_test.php
+++ b/tests/extension/finder_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* 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.
*
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
@@ -128,6 +132,22 @@ class phpbb_extension_finder_test extends phpbb_test_case
);
}
+ public function test_non_absolute_directory_get_classes()
+ {
+ $classes = $this->finder
+ ->directory('type/')
+ ->get_classes();
+
+ sort($classes);
+ $this->assertEquals(
+ array(
+ '\vendor2\foo\sub\type\alternative',
+ '\vendor2\foo\type\alternative',
+ ),
+ $classes
+ );
+ }
+
public function test_sub_directory_get_classes()
{
$classes = $this->finder
diff --git a/tests/extension/includes/acp/acp_foobar.php b/tests/extension/includes/acp/acp_foobar.php
index c256a432e2..c4591cae07 100644
--- a/tests/extension/includes/acp/acp_foobar.php
+++ b/tests/extension/includes/acp/acp_foobar.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* 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.
*
*/
@@ -15,9 +19,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-/**
-* @package acp
-*/
class acp_foobar
{
var $u_action;
diff --git a/tests/extension/includes/acp/info/acp_foobar.php b/tests/extension/includes/acp/info/acp_foobar.php
index b89cfb9574..870225ba4f 100644
--- a/tests/extension/includes/acp/info/acp_foobar.php
+++ b/tests/extension/includes/acp/info/acp_foobar.php
@@ -1,15 +1,16 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* 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.
*
*/
-/**
-* @package module_install
-*/
class acp_foobar_info
{
function module()
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
index 789dc20d14..d9f8fbd1a4 100644
--- a/tests/extension/manager_test.php
+++ b/tests/extension/manager_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* 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.
*
*/
@@ -97,6 +101,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$phpbb_root_path = __DIR__ . './../../phpBB/';
$php_ext = 'php';
$table_prefix = 'phpbb_';
+ $user = new \phpbb\user();
$migrator = new \phpbb\db\migrator(
$config,
@@ -117,6 +122,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$db,
$config,
new \phpbb\filesystem(),
+ $user,
'phpbb_ext',
dirname(__FILE__) . '/',
$php_ext,
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index a3584be67b..3678ac0a3f 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* 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.
*
*/
@@ -73,6 +77,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->db,
$this->config,
new \phpbb\filesystem(),
+ $this->user,
'phpbb_ext',
$this->phpbb_root_path,
$this->phpEx,
@@ -93,7 +98,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e){}
- $this->assertEquals((string) $e, 'The required file does not exist: ' . $this->phpbb_root_path . $this->extension_manager->get_extension_path($ext_name) . 'composer.json');
+ $this->assertEquals((string) $e, $this->user->lang('FILE_NOT_FOUND', $this->phpbb_root_path . $this->extension_manager->get_extension_path($ext_name) . 'composer.json'));
}
// Should be the same as a direct json_decode of the composer.json file
@@ -132,7 +137,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, 'Required meta field \'name\' has not been set.');
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'name'));
}
try
@@ -143,7 +148,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, 'Required meta field \'type\' has not been set.');
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'type'));
}
try
@@ -154,7 +159,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, 'Required meta field \'license\' has not been set.');
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'license'));
}
try
@@ -165,7 +170,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, 'Required meta field \'version\' has not been set.');
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'version'));
}
try
@@ -176,7 +181,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, 'Required meta field \'authors\' has not been set.');
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'authors'));
}
$manager->merge_metadata(array(
@@ -193,7 +198,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, 'Required meta field \'author name\' has not been set.');
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'author name'));
}
}
@@ -220,7 +225,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, 'Meta field \'name\' is invalid.');
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'name'));
}
try
@@ -231,7 +236,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, 'Meta field \'type\' is invalid.');
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'type'));
}
try
@@ -242,7 +247,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, 'Meta field \'license\' is invalid.');
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'license'));
}
try
@@ -253,7 +258,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, 'Meta field \'version\' is invalid.');
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'version'));
}
}
@@ -433,6 +438,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->config,
$this->extension_manager,
$this->template,
+ $this->user,
$this->phpbb_root_path
);
}
diff --git a/tests/extension/modules_test.php b/tests/extension/modules_test.php
index e396b7b73e..21f1c6aca5 100644
--- a/tests/extension/modules_test.php
+++ b/tests/extension/modules_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package testing
-* @copyright (c) 2013 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* 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.
*
*/