mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10013] Fixed cache test to create intermediate directories.
PHPBB3-10013
This commit is contained in:
parent
8de411cc25
commit
4e446277a5
2 changed files with 11 additions and 2 deletions
4
tests/cache/cache_test.php
vendored
4
tests/cache/cache_test.php
vendored
|
@ -15,7 +15,7 @@ class phpbb_cache_test extends phpbb_test_case
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->cache_dir = dirname(__FILE__) . '/../tmp/cache';
|
$this->cache_dir = dirname(__FILE__) . '/../tmp/cache/';
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
|
@ -39,7 +39,7 @@ class phpbb_cache_test extends phpbb_test_case
|
||||||
|
|
||||||
private function create_cache_dir()
|
private function create_cache_dir()
|
||||||
{
|
{
|
||||||
mkdir($this->cache_dir);
|
$this->get_test_case_helpers()->makedirs($this->cache_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function remove_cache_dir()
|
private function remove_cache_dir()
|
||||||
|
|
|
@ -41,4 +41,13 @@ class phpbb_test_case_helpers
|
||||||
$this->expectedTriggerError = true;
|
$this->expectedTriggerError = true;
|
||||||
$this->test_case->setExpectedException($exceptionName, (string) $message, $errno);
|
$this->test_case->setExpectedException($exceptionName, (string) $message, $errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function makedirs($path)
|
||||||
|
{
|
||||||
|
while (!file_exists($path))
|
||||||
|
{
|
||||||
|
$this->makedirs(dirname($path));
|
||||||
|
mkdir($path);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue