[ticket/10013] Fixed cache test to create intermediate directories.

PHPBB3-10013
This commit is contained in:
Oleg Pudeyev 2011-02-02 10:16:28 -05:00 committed by Igor Wiedler
parent 8de411cc25
commit 4e446277a5
2 changed files with 11 additions and 2 deletions

View file

@ -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()

View file

@ -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);
}
}
}