diff options
author | Marc Alexander <admin@m-a-styles.de> | 2012-12-24 14:34:10 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2012-12-24 14:34:10 +0100 |
commit | c9338b38b35675bd1d620e4a8ca7d44a522faace (patch) | |
tree | 0746db7f0eb5f22780c04e3ece5fb6a549045860 /tests/mock/filesystem_extension_manager.php | |
parent | e6aaef6066549696453063417167e5a79c53b353 (diff) | |
parent | 46b3c3ecc43721e53c9711a196e91c300e03a1c8 (diff) | |
download | forums-c9338b38b35675bd1d620e4a8ca7d44a522faace.tar forums-c9338b38b35675bd1d620e4a8ca7d44a522faace.tar.gz forums-c9338b38b35675bd1d620e4a8ca7d44a522faace.tar.bz2 forums-c9338b38b35675bd1d620e4a8ca7d44a522faace.tar.xz forums-c9338b38b35675bd1d620e4a8ca7d44a522faace.zip |
Merge branch 'develop' of github.com:marc1706/phpbb3 into feature/avatars
Diffstat (limited to 'tests/mock/filesystem_extension_manager.php')
-rw-r--r-- | tests/mock/filesystem_extension_manager.php | 32 |
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); + } +} |