diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-02-02 10:16:28 -0500 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2011-02-12 14:44:53 +0100 |
commit | 4e446277a5f6e4e5772065110d06eb4a46f95b41 (patch) | |
tree | 2434a02b154966e58709031e176dcfdf2a3e7bce /tests | |
parent | 8de411cc25e0a72dea858e247e7200df2fbccfea (diff) | |
download | forums-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.php | 4 | ||||
-rw-r--r-- | tests/test_framework/phpbb_test_case_helpers.php | 9 |
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); + } + } } |