aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mock
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2012-12-10 14:09:10 -0500
committerDavid King <imkingdavid@gmail.com>2012-12-10 14:09:10 -0500
commita9db155c28aa4885c1eef70dffe037172222f91d (patch)
treec8cf9c258b1acbc7fe3a2ff2825a5bdc52595f58 /tests/mock
parenteaa0319867783868a761c9ede5398d52351c38d5 (diff)
parent0446886f91376c258df3729287824e505ff788b3 (diff)
downloadforums-a9db155c28aa4885c1eef70dffe037172222f91d.tar
forums-a9db155c28aa4885c1eef70dffe037172222f91d.tar.gz
forums-a9db155c28aa4885c1eef70dffe037172222f91d.tar.bz2
forums-a9db155c28aa4885c1eef70dffe037172222f91d.tar.xz
forums-a9db155c28aa4885c1eef70dffe037172222f91d.zip
Merge remote-tracking branch 'p/feature/template-events' into develop
# By Oleg Pudeyev (36) and others # Via Oleg Pudeyev * p/feature/template-events: (47 commits) [feature/template-events] Pass arguments in correct order. [feature/template-events] Order extensions in mock extension manager. [feature/template-events] Changes per imkingdavid's review. [feature/template-events] Make style names private on template. [feature/template-events] Test for event that is defined in parent style only. [feature/template-events] Specify style names, add inheritance tests. [feature/template-events] Normalize expected directory trees. [feature/template-events] Allow dataset to be correctly selectable. [feature/template-events] Dataset for template event testing with inheritance. [feature/template-events] Use style names array in template filter. [feature/template-events] Generate style names array in set_style. [feature/template-events] Convert a single style name to array of them. [feature/template-events] Chase dependency injection for template context. [feature/template-events] Adjust template events test to use the dataset. [feature/template-events] Create a dataset for template event tests. [feature/template-events] Indentation fix. [feature/template-events] Cosmetic changes. [feature/template-events] Wording: wrongly -> improperly. [feature/template-events] Indentation fix. [feature/template-events] Rename template_name to style_name. ...
Diffstat (limited to 'tests/mock')
-rw-r--r--tests/mock/filesystem_extension_manager.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/mock/filesystem_extension_manager.php b/tests/mock/filesystem_extension_manager.php
new file mode 100644
index 0000000000..c5a51bbb3f
--- /dev/null
+++ b/tests/mock/filesystem_extension_manager.php
@@ -0,0 +1,32 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class phpbb_mock_filesystem_extension_manager extends phpbb_mock_extension_manager
+{
+ public function __construct($phpbb_root_path)
+ {
+ $extensions = array();
+ $iterator = new DirectoryIterator($phpbb_root_path . 'ext/');
+ foreach ($iterator as $fileinfo)
+ {
+ if ($fileinfo->isDir() && substr($fileinfo->getFilename(), 0, 1) != '.')
+ {
+ $name = $fileinfo->getFilename();
+ $extension = array(
+ 'ext_name' => $name,
+ 'ext_active' => true,
+ 'ext_path' => 'ext/' . $name . '/',
+ );
+ $extensions[$name] = $extension;
+ }
+ }
+ ksort($extensions);
+ parent::__construct($phpbb_root_path, $extensions);
+ }
+}