aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-02-02 10:16:28 -0500
committerIgor Wiedler <igor@wiedler.ch>2011-02-12 14:44:53 +0100
commit4e446277a5f6e4e5772065110d06eb4a46f95b41 (patch)
tree2434a02b154966e58709031e176dcfdf2a3e7bce /tests
parent8de411cc25e0a72dea858e247e7200df2fbccfea (diff)
downloadforums-4e446277a5f6e4e5772065110d06eb4a46f95b41.tar
forums-4e446277a5f6e4e5772065110d06eb4a46f95b41.tar.gz
forums-4e446277a5f6e4e5772065110d06eb4a46f95b41.tar.bz2
forums-4e446277a5f6e4e5772065110d06eb4a46f95b41.tar.xz
forums-4e446277a5f6e4e5772065110d06eb4a46f95b41.zip
[ticket/10013] Fixed cache test to create intermediate directories.
PHPBB3-10013
Diffstat (limited to 'tests')
-rw-r--r--tests/cache/cache_test.php4
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php9
2 files changed, 11 insertions, 2 deletions
diff --git a/tests/cache/cache_test.php b/tests/cache/cache_test.php
index 61908dbe31..b127c507f0 100644
--- a/tests/cache/cache_test.php
+++ b/tests/cache/cache_test.php
@@ -15,7 +15,7 @@ class phpbb_cache_test extends phpbb_test_case
public function __construct()
{
- $this->cache_dir = dirname(__FILE__) . '/../tmp/cache';
+ $this->cache_dir = dirname(__FILE__) . '/../tmp/cache/';
}
protected function setUp()
@@ -39,7 +39,7 @@ class phpbb_cache_test extends phpbb_test_case
private function create_cache_dir()
{
- mkdir($this->cache_dir);
+ $this->get_test_case_helpers()->makedirs($this->cache_dir);
}
private function remove_cache_dir()
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 0acdce32e0..0eec4a90ca 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -41,4 +41,13 @@ class phpbb_test_case_helpers
$this->expectedTriggerError = true;
$this->test_case->setExpectedException($exceptionName, (string) $message, $errno);
}
+
+ public function makedirs($path)
+ {
+ while (!file_exists($path))
+ {
+ $this->makedirs(dirname($path));
+ mkdir($path);
+ }
+ }
}