mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 03:04:09 +02:00
[ticket/15253] Use storage helper methods instead of filesystem methods
PHPBB3-15253
This commit is contained in:
@@ -21,14 +21,12 @@ class phpbb_path_helper_test extends phpbb_test_case
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$filesystem = new \phpbb\filesystem\filesystem();
|
||||
$this->set_phpbb_root_path($filesystem);
|
||||
$this->set_phpbb_root_path();
|
||||
|
||||
$this->path_helper = new \phpbb\path_helper(
|
||||
new \phpbb\symfony_request(
|
||||
new phpbb_mock_request()
|
||||
),
|
||||
new \phpbb\filesystem\filesystem(),
|
||||
$this->createMock('\phpbb\request\request'),
|
||||
$this->phpbb_root_path,
|
||||
'php'
|
||||
@@ -43,9 +41,9 @@ class phpbb_path_helper_test extends phpbb_test_case
|
||||
* any time we wish to use it in one of these functions (and
|
||||
* also in general for everything else)
|
||||
*/
|
||||
public function set_phpbb_root_path($filesystem)
|
||||
public function set_phpbb_root_path()
|
||||
{
|
||||
$this->phpbb_root_path = $filesystem->clean_path(dirname(__FILE__) . '/../../phpBB/');
|
||||
$this->phpbb_root_path = \phpbb\storage\helper::clean_path(dirname(__FILE__) . '/../../phpBB/');
|
||||
}
|
||||
|
||||
public function test_get_web_root_path()
|
||||
@@ -56,8 +54,7 @@ class phpbb_path_helper_test extends phpbb_test_case
|
||||
|
||||
public function basic_update_web_root_path_data()
|
||||
{
|
||||
$filesystem = new \phpbb\filesystem\filesystem();
|
||||
$this->set_phpbb_root_path($filesystem);
|
||||
$this->set_phpbb_root_path();
|
||||
|
||||
return array(
|
||||
array(
|
||||
@@ -75,7 +72,7 @@ class phpbb_path_helper_test extends phpbb_test_case
|
||||
),
|
||||
array(
|
||||
$this->phpbb_root_path . $this->phpbb_root_path . 'test.php',
|
||||
$filesystem->clean_path($this->phpbb_root_path . $this->phpbb_root_path . 'test.php'),
|
||||
\phpbb\storage\helper::clean_path($this->phpbb_root_path . $this->phpbb_root_path . 'test.php'),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -90,7 +87,7 @@ class phpbb_path_helper_test extends phpbb_test_case
|
||||
|
||||
public function update_web_root_path_data()
|
||||
{
|
||||
$this->set_phpbb_root_path(new \phpbb\filesystem\filesystem());
|
||||
$this->set_phpbb_root_path();
|
||||
|
||||
return array(
|
||||
array(
|
||||
@@ -195,7 +192,6 @@ class phpbb_path_helper_test extends phpbb_test_case
|
||||
|
||||
$path_helper = new \phpbb\path_helper(
|
||||
$symfony_request,
|
||||
new \phpbb\filesystem\filesystem(),
|
||||
$this->createMock('\phpbb\request\request'),
|
||||
$this->phpbb_root_path,
|
||||
'php'
|
||||
|
Reference in New Issue
Block a user