1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-20 07:21:30 +02:00

[ticket/12009] Move valid extensions in tests to correct dir structure.

PHPBB3-12009
This commit is contained in:
Cesar G
2013-12-12 04:29:48 -08:00
parent 4d65727acc
commit 31234b26d8
27 changed files with 145 additions and 97 deletions

View File

@@ -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')),
),
);
}
}

View File

@@ -0,0 +1,7 @@
<?php
namespace vendor2\bar\acp;
class a_module
{
}

View File

@@ -0,0 +1,21 @@
{
"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",
"licence": "GPL-2.0",
"authors": [{
"name": "John Smith",
"email": "email@phpbb.com",
"homepage": "http://phpbb.com",
"role": "N/A"
}],
"require": {
"php": ">=5.3",
"phpbb/phpbb": "3.1.*@dev"
},
"extra": {
"display-name": "phpBB Bar Extension"
}
}

View File

@@ -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;
}
}

View File

@@ -0,0 +1,7 @@
<?php
namespace vendor2\foo;
class a_class
{
}

View File

@@ -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' => '', 'cat' => array('ACP_MODS')),
),
);
}
}

View File

@@ -0,0 +1,7 @@
<?php
namespace vendor2\foo\acp;
class a_module
{
}

View File

@@ -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')),
),
);
}
}

View File

@@ -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
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace vendor2\foo;
class b_class
{
}

View File

@@ -0,0 +1,21 @@
{
"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",
"licence": "GPL-2.0",
"authors": [{
"name": "John Smith",
"email": "email@phpbb.com",
"homepage": "http://phpbb.com",
"role": "N/A"
}],
"require": {
"php": ">=5.3",
"phpbb/phpbb": "3.1.*@dev"
},
"extra": {
"display-name": "phpBB Foo Extension"
}
}

View File

@@ -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;
}
}

View File

@@ -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')),
),
);
}
}

View File

@@ -0,0 +1,7 @@
<?php
namespace vendor2\foo\mcp;
class a_module
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace foo\sub\type;
class alternative
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace foo\type;
class alternative
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace foo\typewrong;
class error
{
}