diff options
-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); + } + } } |