aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extension/ext
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extension/ext')
-rw-r--r--tests/extension/ext/bar/ext.php26
-rw-r--r--tests/extension/ext/bar/my/hidden_class.php7
-rw-r--r--tests/extension/ext/bar/styles/prosilver/template/foobar_body.html1
-rw-r--r--tests/extension/ext/barfoo/acp/a_info.php18
-rw-r--r--tests/extension/ext/barfoo/acp/a_module.php7
-rw-r--r--tests/extension/ext/barfoo/ext.php7
-rw-r--r--tests/extension/ext/foo/a_class.php7
-rw-r--r--tests/extension/ext/foo/acp/a_info.php18
-rw-r--r--tests/extension/ext/foo/acp/a_module.php7
-rw-r--r--tests/extension/ext/foo/acp/fail_info.php22
-rw-r--r--tests/extension/ext/foo/acp/fail_module.php11
-rw-r--r--tests/extension/ext/foo/b_class.php7
-rw-r--r--tests/extension/ext/foo/composer.json22
-rw-r--r--tests/extension/ext/foo/ext.php15
-rw-r--r--tests/extension/ext/foo/mcp/a_info.php18
-rw-r--r--tests/extension/ext/foo/mcp/a_module.php7
-rw-r--r--tests/extension/ext/foo/sub/type/alternative.php7
-rw-r--r--tests/extension/ext/foo/type/alternative.php7
-rw-r--r--tests/extension/ext/foo/type/dummy/empty.txt0
-rw-r--r--tests/extension/ext/foo/typewrong/error.php7
-rw-r--r--tests/extension/ext/vendor/moo/composer.json22
-rw-r--r--tests/extension/ext/vendor/moo/ext.php15
-rw-r--r--tests/extension/ext/vendor/moo/feature_class.php7
23 files changed, 265 insertions, 0 deletions
diff --git a/tests/extension/ext/bar/ext.php b/tests/extension/ext/bar/ext.php
new file mode 100644
index 0000000000..22ff5e8077
--- /dev/null
+++ b/tests/extension/ext/bar/ext.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace 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/bar/my/hidden_class.php b/tests/extension/ext/bar/my/hidden_class.php
new file mode 100644
index 0000000000..504c1873dc
--- /dev/null
+++ b/tests/extension/ext/bar/my/hidden_class.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace bar\my;
+
+class hidden_class
+{
+}
diff --git a/tests/extension/ext/bar/styles/prosilver/template/foobar_body.html b/tests/extension/ext/bar/styles/prosilver/template/foobar_body.html
new file mode 100644
index 0000000000..00c2a84a18
--- /dev/null
+++ b/tests/extension/ext/bar/styles/prosilver/template/foobar_body.html
@@ -0,0 +1 @@
+bertie rules!
diff --git a/tests/extension/ext/barfoo/acp/a_info.php b/tests/extension/ext/barfoo/acp/a_info.php
new file mode 100644
index 0000000000..ea07189f7a
--- /dev/null
+++ b/tests/extension/ext/barfoo/acp/a_info.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace barfoo\acp;
+
+class a_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => 'barfoo\\acp\\a_module',
+ 'title' => 'Barfoo',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')),
+ ),
+ );
+ }
+}
diff --git a/tests/extension/ext/barfoo/acp/a_module.php b/tests/extension/ext/barfoo/acp/a_module.php
new file mode 100644
index 0000000000..0ae8775013
--- /dev/null
+++ b/tests/extension/ext/barfoo/acp/a_module.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace barfoo\acp;
+
+class a_module
+{
+}
diff --git a/tests/extension/ext/barfoo/ext.php b/tests/extension/ext/barfoo/ext.php
new file mode 100644
index 0000000000..1b7bb7ca5e
--- /dev/null
+++ b/tests/extension/ext/barfoo/ext.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace barfoo;
+
+class ext extends \phpbb\extension\base
+{
+}
diff --git a/tests/extension/ext/foo/a_class.php b/tests/extension/ext/foo/a_class.php
new file mode 100644
index 0000000000..9db45a697f
--- /dev/null
+++ b/tests/extension/ext/foo/a_class.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo;
+
+class a_class
+{
+}
diff --git a/tests/extension/ext/foo/acp/a_info.php b/tests/extension/ext/foo/acp/a_info.php
new file mode 100644
index 0000000000..3b7d8cdd42
--- /dev/null
+++ b/tests/extension/ext/foo/acp/a_info.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace foo\acp;
+
+class a_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => 'foo\\acp\\a_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/foo/acp/a_module.php b/tests/extension/ext/foo/acp/a_module.php
new file mode 100644
index 0000000000..7aa2351ab3
--- /dev/null
+++ b/tests/extension/ext/foo/acp/a_module.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo\acp;
+
+class a_module
+{
+}
diff --git a/tests/extension/ext/foo/acp/fail_info.php b/tests/extension/ext/foo/acp/fail_info.php
new file mode 100644
index 0000000000..01d29fc5eb
--- /dev/null
+++ b/tests/extension/ext/foo/acp/fail_info.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace 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' => '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/foo/acp/fail_module.php b/tests/extension/ext/foo/acp/fail_module.php
new file mode 100644
index 0000000000..8070929d3c
--- /dev/null
+++ b/tests/extension/ext/foo/acp/fail_module.php
@@ -0,0 +1,11 @@
+<?php
+
+namespace 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/foo/b_class.php b/tests/extension/ext/foo/b_class.php
new file mode 100644
index 0000000000..bb2a77c05e
--- /dev/null
+++ b/tests/extension/ext/foo/b_class.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo;
+
+class b_class
+{
+}
diff --git a/tests/extension/ext/foo/composer.json b/tests/extension/ext/foo/composer.json
new file mode 100644
index 0000000000..744f7be625
--- /dev/null
+++ b/tests/extension/ext/foo/composer.json
@@ -0,0 +1,22 @@
+{
+ "name": "foo/example",
+ "type": "phpbb3-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",
+ "licence": "GPL-2.0",
+ "authors": [{
+ "name": "Nathan Guse",
+ "username": "EXreaction",
+ "email": "email@phpbb.com",
+ "homepage": "http://lithiumstudios.org",
+ "role": "N/A"
+ }],
+ "require": {
+ "php": ">=5.3",
+ "phpbb": "3.1.0-dev"
+ },
+ "extra": {
+ "display-name": "phpBB Foo Extension"
+ }
+}
diff --git a/tests/extension/ext/foo/ext.php b/tests/extension/ext/foo/ext.php
new file mode 100644
index 0000000000..ac6098f2f1
--- /dev/null
+++ b/tests/extension/ext/foo/ext.php
@@ -0,0 +1,15 @@
+<?php
+
+namespace 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/foo/mcp/a_info.php b/tests/extension/ext/foo/mcp/a_info.php
new file mode 100644
index 0000000000..9a896ce808
--- /dev/null
+++ b/tests/extension/ext/foo/mcp/a_info.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace foo\mcp;
+
+class a_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => '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/foo/mcp/a_module.php b/tests/extension/ext/foo/mcp/a_module.php
new file mode 100644
index 0000000000..ca397e7004
--- /dev/null
+++ b/tests/extension/ext/foo/mcp/a_module.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo\mcp;
+
+class a_module
+{
+}
diff --git a/tests/extension/ext/foo/sub/type/alternative.php b/tests/extension/ext/foo/sub/type/alternative.php
new file mode 100644
index 0000000000..1eaf794609
--- /dev/null
+++ b/tests/extension/ext/foo/sub/type/alternative.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo\sub\type;
+
+class alternative
+{
+}
diff --git a/tests/extension/ext/foo/type/alternative.php b/tests/extension/ext/foo/type/alternative.php
new file mode 100644
index 0000000000..8f753491ef
--- /dev/null
+++ b/tests/extension/ext/foo/type/alternative.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo\type;
+
+class alternative
+{
+}
diff --git a/tests/extension/ext/foo/type/dummy/empty.txt b/tests/extension/ext/foo/type/dummy/empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/extension/ext/foo/type/dummy/empty.txt
diff --git a/tests/extension/ext/foo/typewrong/error.php b/tests/extension/ext/foo/typewrong/error.php
new file mode 100644
index 0000000000..5020926043
--- /dev/null
+++ b/tests/extension/ext/foo/typewrong/error.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace foo\typewrong;
+
+class error
+{
+}
diff --git a/tests/extension/ext/vendor/moo/composer.json b/tests/extension/ext/vendor/moo/composer.json
new file mode 100644
index 0000000000..c91a5e027b
--- /dev/null
+++ b/tests/extension/ext/vendor/moo/composer.json
@@ -0,0 +1,22 @@
+{
+ "name": "moo/example",
+ "type": "phpbb3-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",
+ "licence": "GNU GPL v2",
+ "authors": [{
+ "name": "Nathan Guse",
+ "username": "EXreaction",
+ "email": "email@phpbb.com",
+ "homepage": "http://lithiumstudios.org",
+ "role": "N/A"
+ }],
+ "require": {
+ "php": ">=5.3",
+ "phpbb": "3.1.0-dev"
+ },
+ "extra": {
+ "display-name": "phpBB Moo Extension"
+ }
+}
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
+{
+}