aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extension
diff options
context:
space:
mode:
authorMaat <maat-pub@mageia.biz>2020-05-09 01:15:08 +0200
committerMaat <maat-pub@mageia.biz>2020-05-09 01:15:08 +0200
commit6985226b17e8a0ef0a720bf1d12fe0c216e13dab (patch)
tree116d2565ac02c40abe0548863c6badf8ec3e1d1e /tests/extension
parent8ea437e30605e0f66b5220bf904a61d7c1d11ddd (diff)
parent8d00784dfe2c8bcb10843ff70b4cfa998d703285 (diff)
downloadforums-6985226b17e8a0ef0a720bf1d12fe0c216e13dab.tar
forums-6985226b17e8a0ef0a720bf1d12fe0c216e13dab.tar.gz
forums-6985226b17e8a0ef0a720bf1d12fe0c216e13dab.tar.bz2
forums-6985226b17e8a0ef0a720bf1d12fe0c216e13dab.tar.xz
forums-6985226b17e8a0ef0a720bf1d12fe0c216e13dab.zip
Merge remote-tracking branch 'upstream/prep-release-3.3.0'HEADmaster
Diffstat (limited to 'tests/extension')
-rw-r--r--tests/extension/ext/vendor5/foo/composer.json23
-rw-r--r--tests/extension/ext/vendor5/foo/ext.php19
-rw-r--r--tests/extension/extension_base_test.php2
-rw-r--r--tests/extension/finder_test.php4
-rw-r--r--tests/extension/manager_test.php4
-rw-r--r--tests/extension/metadata_manager_test.php6
-rw-r--r--tests/extension/modules_test.php4
7 files changed, 52 insertions, 10 deletions
diff --git a/tests/extension/ext/vendor5/foo/composer.json b/tests/extension/ext/vendor5/foo/composer.json
new file mode 100644
index 0000000000..0fa052e188
--- /dev/null
+++ b/tests/extension/ext/vendor5/foo/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "vendor5/foo",
+ "type": "phpbb-extension",
+ "description": "An example/sample extension to be used for testing purposes in phpBB Development.",
+ "version": "1.0.0",
+ "time": "2012-02-15 01:01:01",
+ "license": "GPL-2.0",
+ "authors": [{
+ "name": "John Smith",
+ "email": "email@phpbb.com",
+ "homepage": "http://phpbb.com",
+ "role": "N/A"
+ }],
+ "require": {
+ "php": ">=5.3"
+ },
+ "extra": {
+ "display-name": "phpBB Bar Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.3.*@dev"
+ }
+ }
+}
diff --git a/tests/extension/ext/vendor5/foo/ext.php b/tests/extension/ext/vendor5/foo/ext.php
new file mode 100644
index 0000000000..6bf03f001c
--- /dev/null
+++ b/tests/extension/ext/vendor5/foo/ext.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace vendor5\foo;
+
+class ext extends \phpbb\extension\base
+{
+ static public $enabled;
+
+ public function is_enableable()
+ {
+ return array('Reason 1', 'Reason 2');
+ }
+
+ public function enable_step($old_state)
+ {
+ self::$enabled = true;
+ return self::$enabled;
+ }
+}
diff --git a/tests/extension/extension_base_test.php b/tests/extension/extension_base_test.php
index e0c2e6d549..1f44fdb234 100644
--- a/tests/extension/extension_base_test.php
+++ b/tests/extension/extension_base_test.php
@@ -30,7 +30,7 @@ class phpbb_extension_extension_base_test extends phpbb_test_case
self::$reflection_method_get_migration_file_list->setAccessible(true);
}
- public function setUp()
+ public function setUp(): void
{
$container = new phpbb_mock_container_builder();
$migrator = new phpbb_mock_migrator();
diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php
index 71de2c2fc5..7649b4f19a 100644
--- a/tests/extension/finder_test.php
+++ b/tests/extension/finder_test.php
@@ -18,7 +18,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
/** @var \phpbb\finder */
protected $finder;
- public function setUp()
+ public function setUp(): void
{
$this->extension_manager = new phpbb_mock_extension_manager(
dirname(__FILE__) . '/',
@@ -239,7 +239,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
/**
* 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
+ * They do not seem necessary to me, so I am commenting them out for now
public function test_get_classes_create_cache()
{
$cache = new phpbb_mock_cache;
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
index f619d4c19d..3ab0f608d1 100644
--- a/tests/extension/manager_test.php
+++ b/tests/extension/manager_test.php
@@ -26,7 +26,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml');
}
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -36,7 +36,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
public function test_all_available()
{
// barfoo and vendor3/bar should not listed due to missing composer.json. barfoo also has incorrect dir structure.
- $this->assertEquals(array('vendor/moo', 'vendor2/bar', 'vendor2/foo', 'vendor3/foo', 'vendor4/bar'), array_keys($this->extension_manager->all_available()));
+ $this->assertEquals(array('vendor/moo', 'vendor2/bar', 'vendor2/foo', 'vendor3/foo', 'vendor4/bar', 'vendor5/foo'), array_keys($this->extension_manager->all_available()));
}
public function test_all_enabled()
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index 533da68c57..a2f0542979 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -32,7 +32,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/extensions.xml');
}
- protected function setUp()
+ protected function setUp(): void
{
parent::setUp();
@@ -59,7 +59,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
new phpbb_mock_request()
),
$filesystem,
- $this->getMock('\phpbb\request\request'),
+ $this->createMock('\phpbb\request\request'),
$this->phpbb_root_path,
$this->phpEx
);
@@ -111,7 +111,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$lang = new \phpbb\language\language($lang_loader);
$this->user = new \phpbb\user($lang, '\phpbb\datetime');
- $this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
+ $this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $twig, $this->user)));
$twig->setLexer(new \phpbb\template\twig\lexer($twig));
}
diff --git a/tests/extension/modules_test.php b/tests/extension/modules_test.php
index 88634bc6ba..f8c65bc147 100644
--- a/tests/extension/modules_test.php
+++ b/tests/extension/modules_test.php
@@ -24,7 +24,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
protected $finder;
protected $module_manager;
- public function setUp()
+ public function setUp(): void
{
global $phpbb_extension_manager;
@@ -46,7 +46,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
$this->module_manager = new \phpbb\module\module_manager(
new \phpbb\cache\driver\dummy(),
- $this->getMock('\phpbb\db\driver\driver_interface'),
+ $this->createMock('\phpbb\db\driver\driver_interface'),
$this->extension_manager,
MODULES_TABLE,
dirname(__FILE__) . '/',