aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mock
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2012-12-12 16:30:50 -0600
committerNathaniel Guse <nathaniel.guse@gmail.com>2012-12-12 16:30:50 -0600
commit7ae5b62fc68017b6bdd5e55c9641e92a86a1f487 (patch)
tree54e156815f13c40e9b880712de32ae13728ffdae /tests/mock
parent84284a9ccee7d5ccc658c3d1f751a5254b3b9175 (diff)
parent9420647c43b300699afe6fe72f09d1746daf64a2 (diff)
downloadforums-7ae5b62fc68017b6bdd5e55c9641e92a86a1f487.tar
forums-7ae5b62fc68017b6bdd5e55c9641e92a86a1f487.tar.gz
forums-7ae5b62fc68017b6bdd5e55c9641e92a86a1f487.tar.bz2
forums-7ae5b62fc68017b6bdd5e55c9641e92a86a1f487.tar.xz
forums-7ae5b62fc68017b6bdd5e55c9641e92a86a1f487.zip
Merge branch 'develop' of git://github.com/phpbb/phpbb3 into ticket/11103
Diffstat (limited to 'tests/mock')
-rw-r--r--tests/mock/filesystem_extension_manager.php32
-rw-r--r--tests/mock/null_cache.php47
2 files changed, 79 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);
+ }
+}
diff --git a/tests/mock/null_cache.php b/tests/mock/null_cache.php
new file mode 100644
index 0000000000..7bd33b441b
--- /dev/null
+++ b/tests/mock/null_cache.php
@@ -0,0 +1,47 @@
+<?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_null_cache
+{
+ public function __construct()
+ {
+ }
+
+ public function get($var_name)
+ {
+ return false;
+ }
+
+ public function put($var_name, $var, $ttl = 0)
+ {
+ }
+
+ public function destroy($var_name, $table = '')
+ {
+ }
+
+ public function obtain_bots()
+ {
+ return array();
+ }
+
+ public function obtain_word_list()
+ {
+ return array();
+ }
+
+ public function set_bots($bots)
+ {
+ }
+
+ public function sql_exists($query_id)
+ {
+ return false;
+ }
+}