mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/15276] Use storage in avatar test
PHPBB3-15276
This commit is contained in:
parent
41af01b1ee
commit
929e32e80d
1 changed files with 9 additions and 1 deletions
|
@ -36,6 +36,13 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||||
->will($this->returnArgument(0));
|
->will($this->returnArgument(0));
|
||||||
|
|
||||||
$filesystem = new \phpbb\filesystem\filesystem();
|
$filesystem = new \phpbb\filesystem\filesystem();
|
||||||
|
$adapter = new \phpbb\storage\adapter\local($filesystem, $phpbb_root_path);
|
||||||
|
$adapter->configure(['path' => 'images/avatars/upload']);
|
||||||
|
$adapter_factory_mock = $this->createMock('\phpbb\storage\adapter_factory');
|
||||||
|
$adapter_factory_mock->expects($this->any())
|
||||||
|
->method('get')
|
||||||
|
->willReturn($adapter);
|
||||||
|
$storage = new \phpbb\storage\storage($adapter_factory_mock, '');
|
||||||
|
|
||||||
// Prepare dependencies for avatar manager and driver
|
// Prepare dependencies for avatar manager and driver
|
||||||
$this->config = new \phpbb\config\config(array());
|
$this->config = new \phpbb\config\config(array());
|
||||||
|
@ -86,6 +93,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||||
{
|
{
|
||||||
if ($driver !== 'upload')
|
if ($driver !== 'upload')
|
||||||
{
|
{
|
||||||
|
|
||||||
$cur_avatar = $this->getMockBuilder('\phpbb\avatar\driver\\' . $driver)
|
$cur_avatar = $this->getMockBuilder('\phpbb\avatar\driver\\' . $driver)
|
||||||
->setMethods(array('get_name'))
|
->setMethods(array('get_name'))
|
||||||
->setConstructorArgs(array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache))
|
->setConstructorArgs(array($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache))
|
||||||
|
@ -95,7 +103,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||||
{
|
{
|
||||||
$cur_avatar = $this->getMockBuilder('\phpbb\avatar\driver\\' . $driver)
|
$cur_avatar = $this->getMockBuilder('\phpbb\avatar\driver\\' . $driver)
|
||||||
->setMethods(array('get_name'))
|
->setMethods(array('get_name'))
|
||||||
->setConstructorArgs(array($this->config, $phpbb_root_path, $phpEx, $filesystem, $path_helper, $dispatcher, $files_factory, $cache))
|
->setConstructorArgs(array($this->config, $phpbb_root_path, $phpEx, $storage, $path_helper, $dispatcher, $files_factory, $cache))
|
||||||
->getMock();
|
->getMock();
|
||||||
}
|
}
|
||||||
$cur_avatar->expects($this->any())
|
$cur_avatar->expects($this->any())
|
||||||
|
|
Loading…
Add table
Reference in a new issue