diff options
Diffstat (limited to 'tests/extension/ext')
31 files changed, 426 insertions, 0 deletions
diff --git a/tests/extension/ext/barfoo/composer.json b/tests/extension/ext/barfoo/composer.json new file mode 100644 index 0000000000..05bb099707 --- /dev/null +++ b/tests/extension/ext/barfoo/composer.json @@ -0,0 +1,24 @@ +{ + "name": "vendor/barfoo", + "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": "GNU GPL v2", + "authors": [{ + "name": "John Smith", + "username": "JohnSmith27", + "email": "email@phpbb.com", + "homepage": "http://phpbb.com", + "role": "N/A" + }], + "require": { + "php": ">=5.3" + }, + "extra": { + "display-name": "phpBB BarFoo Extension", + "soft-require": { + "phpbb/phpbb": "3.1.*@dev" + } + } +} diff --git a/tests/extension/ext/barfoo/ext.php b/tests/extension/ext/barfoo/ext.php new file mode 100644 index 0000000000..0de403424c --- /dev/null +++ b/tests/extension/ext/barfoo/ext.php @@ -0,0 +1,7 @@ +<?php + +namespace vendor\barfoo; + +class ext extends \phpbb\extension\base +{ +} diff --git a/tests/extension/ext/vendor/moo/composer.json b/tests/extension/ext/vendor/moo/composer.json new file mode 100644 index 0000000000..d49aab47cd --- /dev/null +++ b/tests/extension/ext/vendor/moo/composer.json @@ -0,0 +1,24 @@ +{ + "name": "vendor/moo", + "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": "GNU GPL v2", + "authors": [{ + "name": "John Smith", + "username": "JohnSmith27", + "email": "email@phpbb.com", + "homepage": "http://phpbb.com", + "role": "N/A" + }], + "require": { + "php": ">=5.3" + }, + "extra": { + "display-name": "phpBB Moo Extension", + "soft-require": { + "phpbb/phpbb": "3.1.*@dev" + } + } +} diff --git a/tests/extension/ext/vendor/moo/ext.php b/tests/extension/ext/vendor/moo/ext.php new file mode 100644 index 0000000000..41ef570452 --- /dev/null +++ b/tests/extension/ext/vendor/moo/ext.php @@ -0,0 +1,15 @@ +<?php + +namespace vendor\moo; + +class ext extends \phpbb\extension\base +{ + static public $purged; + + public function purge_step($old_state) + { + self::$purged = true; + + return false; + } +} diff --git a/tests/extension/ext/vendor/moo/feature_class.php b/tests/extension/ext/vendor/moo/feature_class.php new file mode 100644 index 0000000000..cb8bb3da56 --- /dev/null +++ b/tests/extension/ext/vendor/moo/feature_class.php @@ -0,0 +1,7 @@ +<?php + +namespace vendor\moo; + +class feature_class +{ +} diff --git a/tests/extension/ext/vendor2/bar/acp/a_info.php b/tests/extension/ext/vendor2/bar/acp/a_info.php new file mode 100644 index 0000000000..8132df587f --- /dev/null +++ b/tests/extension/ext/vendor2/bar/acp/a_info.php @@ -0,0 +1,18 @@ +<?php + +namespace vendor2\bar\acp; + +class a_info +{ + public function module() + { + return array( + 'filename' => 'vendor2\\bar\\acp\\a_module', + 'title' => 'Bar', + 'version' => '3.1.0-dev', + 'modes' => array( + 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')), + ), + ); + } +} diff --git a/tests/extension/ext/vendor2/bar/acp/a_module.php b/tests/extension/ext/vendor2/bar/acp/a_module.php new file mode 100644 index 0000000000..3a3d105790 --- /dev/null +++ b/tests/extension/ext/vendor2/bar/acp/a_module.php @@ -0,0 +1,7 @@ +<?php + +namespace vendor2\bar\acp; + +class a_module +{ +} diff --git a/tests/extension/ext/vendor2/bar/composer.json b/tests/extension/ext/vendor2/bar/composer.json new file mode 100644 index 0000000000..9d2ed86a0c --- /dev/null +++ b/tests/extension/ext/vendor2/bar/composer.json @@ -0,0 +1,23 @@ +{ + "name": "vendor2/bar", + "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.1.*@dev" + } + } +} diff --git a/tests/extension/ext/vendor2/bar/ext.php b/tests/extension/ext/vendor2/bar/ext.php new file mode 100644 index 0000000000..f94ab9ad81 --- /dev/null +++ b/tests/extension/ext/vendor2/bar/ext.php @@ -0,0 +1,26 @@ +<?php + +namespace vendor2\bar; + +class ext extends \phpbb\extension\base +{ + static public $state; + + public function enable_step($old_state) + { + // run 4 steps, then quit + if ($old_state === 4) + { + return false; + } + + if ($old_state === false) + { + $old_state = 0; + } + + self::$state = ++$old_state; + + return self::$state; + } +} diff --git a/tests/extension/ext/vendor2/bar/migrations/migration.php b/tests/extension/ext/vendor2/bar/migrations/migration.php new file mode 100644 index 0000000000..71caa34fd9 --- /dev/null +++ b/tests/extension/ext/vendor2/bar/migrations/migration.php @@ -0,0 +1,18 @@ +<?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. +* +*/ + +namespace vendor2\bar\migrations; + +class migration extends \phpbb\db\migration\migration +{ +} diff --git a/tests/extension/ext/vendor2/foo/a_class.php b/tests/extension/ext/vendor2/foo/a_class.php new file mode 100644 index 0000000000..06278c0e0c --- /dev/null +++ b/tests/extension/ext/vendor2/foo/a_class.php @@ -0,0 +1,7 @@ +<?php + +namespace vendor2\foo; + +class a_class +{ +} diff --git a/tests/extension/ext/vendor2/foo/acp/a_info.php b/tests/extension/ext/vendor2/foo/acp/a_info.php new file mode 100644 index 0000000000..e1eaa340b7 --- /dev/null +++ b/tests/extension/ext/vendor2/foo/acp/a_info.php @@ -0,0 +1,18 @@ +<?php + +namespace vendor2\foo\acp; + +class a_info +{ + public function module() + { + return array( + 'filename' => 'vendor2\\foo\\acp\\a_module', + 'title' => 'Foobar', + 'version' => '3.1.0-dev', + 'modes' => array( + 'config' => array('title' => 'Config', 'auth' => 'ext_vendor2/foo', 'cat' => array('ACP_MODS')), + ), + ); + } +} diff --git a/tests/extension/ext/vendor2/foo/acp/a_module.php b/tests/extension/ext/vendor2/foo/acp/a_module.php new file mode 100644 index 0000000000..78d91af2fe --- /dev/null +++ b/tests/extension/ext/vendor2/foo/acp/a_module.php @@ -0,0 +1,7 @@ +<?php + +namespace vendor2\foo\acp; + +class a_module +{ +} diff --git a/tests/extension/ext/vendor2/foo/acp/fail_info.php b/tests/extension/ext/vendor2/foo/acp/fail_info.php new file mode 100644 index 0000000000..d9b4353957 --- /dev/null +++ b/tests/extension/ext/vendor2/foo/acp/fail_info.php @@ -0,0 +1,22 @@ +<?php + +namespace vendor2\foo\acp; + +/* +* Due to the mismatch between the class name and the file name, this module +* file shouldn't be found by the extension finder +*/ +class foo_info +{ + public function module() + { + return array( + 'filename' => 'vendor2\foo\acp\fail_module', + 'title' => 'Foobar', + 'version' => '3.1.0-dev', + 'modes' => array( + 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')), + ), + ); + } +} diff --git a/tests/extension/ext/vendor2/foo/acp/fail_module.php b/tests/extension/ext/vendor2/foo/acp/fail_module.php new file mode 100644 index 0000000000..c8a5eae745 --- /dev/null +++ b/tests/extension/ext/vendor2/foo/acp/fail_module.php @@ -0,0 +1,11 @@ +<?php + +namespace vendor2\foo\acp; + +/* +* Due to the mismatch between the class name and the file name of the module +* info file, this module's info file shouldn't be found +*/ +class fail_module +{ +} diff --git a/tests/extension/ext/vendor2/foo/b_class.php b/tests/extension/ext/vendor2/foo/b_class.php new file mode 100644 index 0000000000..3d0f193908 --- /dev/null +++ b/tests/extension/ext/vendor2/foo/b_class.php @@ -0,0 +1,7 @@ +<?php + +namespace vendor2\foo; + +class b_class +{ +} diff --git a/tests/extension/ext/vendor2/foo/composer.json b/tests/extension/ext/vendor2/foo/composer.json new file mode 100644 index 0000000000..efcdfc338f --- /dev/null +++ b/tests/extension/ext/vendor2/foo/composer.json @@ -0,0 +1,23 @@ +{ + "name": "vendor2/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 Foo Extension", + "soft-require": { + "phpbb/phpbb": "3.1.*@dev" + } + } +} diff --git a/tests/extension/ext/vendor2/foo/ext.php b/tests/extension/ext/vendor2/foo/ext.php new file mode 100644 index 0000000000..15480fe92a --- /dev/null +++ b/tests/extension/ext/vendor2/foo/ext.php @@ -0,0 +1,15 @@ +<?php + +namespace vendor2\foo; + +class ext extends \phpbb\extension\base +{ + static public $disabled; + + public function disable_step($old_state) + { + self::$disabled = true; + + return false; + } +} diff --git a/tests/extension/ext/vendor2/foo/mcp/a_info.php b/tests/extension/ext/vendor2/foo/mcp/a_info.php new file mode 100644 index 0000000000..b5599fde65 --- /dev/null +++ b/tests/extension/ext/vendor2/foo/mcp/a_info.php @@ -0,0 +1,18 @@ +<?php + +namespace vendor2\foo\mcp; + +class a_info +{ + public function module() + { + return array( + 'filename' => 'vendor2\\foo\\mcp\\a_module', + 'title' => 'Foobar', + 'version' => '3.1.0-dev', + 'modes' => array( + 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('MCP_MAIN')), + ), + ); + } +} diff --git a/tests/extension/ext/vendor2/foo/mcp/a_module.php b/tests/extension/ext/vendor2/foo/mcp/a_module.php new file mode 100644 index 0000000000..fe29783827 --- /dev/null +++ b/tests/extension/ext/vendor2/foo/mcp/a_module.php @@ -0,0 +1,7 @@ +<?php + +namespace vendor2\foo\mcp; + +class a_module +{ +} diff --git a/tests/extension/ext/vendor2/foo/sub/type/alternative.php b/tests/extension/ext/vendor2/foo/sub/type/alternative.php new file mode 100644 index 0000000000..1eaf794609 --- /dev/null +++ b/tests/extension/ext/vendor2/foo/sub/type/alternative.php @@ -0,0 +1,7 @@ +<?php + +namespace foo\sub\type; + +class alternative +{ +} diff --git a/tests/extension/ext/vendor2/foo/type/alternative.php b/tests/extension/ext/vendor2/foo/type/alternative.php new file mode 100644 index 0000000000..8f753491ef --- /dev/null +++ b/tests/extension/ext/vendor2/foo/type/alternative.php @@ -0,0 +1,7 @@ +<?php + +namespace foo\type; + +class alternative +{ +} diff --git a/tests/extension/ext/vendor2/foo/type/dummy/empty.txt b/tests/extension/ext/vendor2/foo/type/dummy/empty.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/extension/ext/vendor2/foo/type/dummy/empty.txt diff --git a/tests/extension/ext/vendor2/foo/typewrong/error.php b/tests/extension/ext/vendor2/foo/typewrong/error.php new file mode 100644 index 0000000000..5020926043 --- /dev/null +++ b/tests/extension/ext/vendor2/foo/typewrong/error.php @@ -0,0 +1,7 @@ +<?php + +namespace foo\typewrong; + +class error +{ +} diff --git a/tests/extension/ext/vendor3/bar/ext.php b/tests/extension/ext/vendor3/bar/ext.php new file mode 100644 index 0000000000..37a5e92059 --- /dev/null +++ b/tests/extension/ext/vendor3/bar/ext.php @@ -0,0 +1,26 @@ +<?php + +namespace vendor3\bar; + +class ext extends \phpbb\extension\base +{ + static public $state; + + public function enable_step($old_state) + { + // run 4 steps, then quit + if ($old_state === 4) + { + return false; + } + + if ($old_state === false) + { + $old_state = 0; + } + + self::$state = ++$old_state; + + return self::$state; + } +} diff --git a/tests/extension/ext/vendor3/bar/my/hidden_class.php b/tests/extension/ext/vendor3/bar/my/hidden_class.php new file mode 100644 index 0000000000..38eb59aadf --- /dev/null +++ b/tests/extension/ext/vendor3/bar/my/hidden_class.php @@ -0,0 +1,7 @@ +<?php + +namespace vendor3\bar\my; + +class hidden_class +{ +} diff --git a/tests/extension/ext/vendor3/bar/styles/prosilver/template/foobar_body.html b/tests/extension/ext/vendor3/bar/styles/prosilver/template/foobar_body.html new file mode 100644 index 0000000000..00c2a84a18 --- /dev/null +++ b/tests/extension/ext/vendor3/bar/styles/prosilver/template/foobar_body.html @@ -0,0 +1 @@ +bertie rules! diff --git a/tests/extension/ext/vendor3/foo/composer.json b/tests/extension/ext/vendor3/foo/composer.json new file mode 100644 index 0000000000..b4b3e6f32f --- /dev/null +++ b/tests/extension/ext/vendor3/foo/composer.json @@ -0,0 +1,23 @@ +{ + "name": "vendor3/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.1.*@dev" + } + } +} diff --git a/tests/extension/ext/vendor3/foo/ext.php b/tests/extension/ext/vendor3/foo/ext.php new file mode 100644 index 0000000000..b52649d921 --- /dev/null +++ b/tests/extension/ext/vendor3/foo/ext.php @@ -0,0 +1,20 @@ +<?php + +namespace vendor3\foo; + +class ext extends \phpbb\extension\base +{ + static public $enabled; + + public function enable_step($old_state) + { + self::$enabled = true; + + return self::$enabled; + } + + public function is_enableable() + { + return false; + } +} diff --git a/tests/extension/ext/vendor4/bar/composer.json b/tests/extension/ext/vendor4/bar/composer.json new file mode 100644 index 0000000000..1a2fddc3f4 --- /dev/null +++ b/tests/extension/ext/vendor4/bar/composer.json @@ -0,0 +1,23 @@ +{ + "name": "vendor4/bar", + "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.1.*@dev" + } + } +} diff --git a/tests/extension/ext/vendor4/bar/styles/all/template/foobar_body.html b/tests/extension/ext/vendor4/bar/styles/all/template/foobar_body.html new file mode 100644 index 0000000000..c8f8cf957e --- /dev/null +++ b/tests/extension/ext/vendor4/bar/styles/all/template/foobar_body.html @@ -0,0 +1 @@ +All folder |