Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
13 / 13 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| phpbb_mock_filesystem_extension_manager | |
100.00% |
13 / 13 |
|
100.00% |
1 / 1 |
4 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
13 / 13 |
|
100.00% |
1 / 1 |
4 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * |
| 4 | * This file is part of the phpBB Forum Software package. |
| 5 | * |
| 6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
| 7 | * @license GNU General Public License, version 2 (GPL-2.0) |
| 8 | * |
| 9 | * For full copyright and license information, please see |
| 10 | * the docs/CREDITS.txt file. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | class phpbb_mock_filesystem_extension_manager extends phpbb_mock_extension_manager |
| 15 | { |
| 16 | public function __construct($phpbb_root_path) |
| 17 | { |
| 18 | $extensions = array(); |
| 19 | $iterator = new DirectoryIterator($phpbb_root_path . 'ext/'); |
| 20 | foreach ($iterator as $fileinfo) |
| 21 | { |
| 22 | if ($fileinfo->isDir() && substr($fileinfo->getFilename(), 0, 1) != '.') |
| 23 | { |
| 24 | $name = $fileinfo->getFilename(); |
| 25 | $extension = array( |
| 26 | 'ext_name' => $name, |
| 27 | 'ext_active' => true, |
| 28 | 'ext_path' => 'ext/' . $name . '/', |
| 29 | ); |
| 30 | $extensions[$name] = $extension; |
| 31 | } |
| 32 | } |
| 33 | ksort($extensions); |
| 34 | parent::__construct($phpbb_root_path, $extensions); |
| 35 | } |
| 36 | } |