mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 03:04:09 +02:00
Merge pull request #4894 from rubencm/ticket/15276
[ticket/15276] Use storage in avatars * github.com:phpbb/phpbb: (34 commits) [ticket/15276] Changed annotation [ticket/15276] Remove unused code [ticket/15276] Revert some changes [ticket/15276] Use IniGetWrapper [ticket/15276] Add missing dependency [ticket/15276] Remove unused dependency [ticket/15276] Add missing properties [ticket/15276] Use InitGetWrapper [ticket/15276] Fix comments [ticket/15276] Fix code and add phpdoc [ticket/15276] Use stream_copy_to_stream [ticket/15276] Fix typo [ticket/15276] Use mimetype guesser [ticket/15276] Update file_info to get size of images [ticket/15276] Update [ticket/15276] Remove avatar_path [ticket/15276] Remove avatar_path from acp [ticket/15276] Use finfo to get mimetype [ticket/15276] Update file_info [ticket/15276] Fix code style ...
This commit is contained in:
@@ -36,6 +36,13 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||
->will($this->returnArgument(0));
|
||||
|
||||
$filesystem = new \phpbb\filesystem\filesystem();
|
||||
$adapter = new \phpbb\storage\adapter\local($filesystem, new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $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
|
||||
$this->config = new \phpbb\config\config(array());
|
||||
@@ -82,6 +89,8 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||
|
||||
$files_factory = new \phpbb\files\factory($phpbb_container);
|
||||
|
||||
$php_ini = new \bantu\IniGetWrapper\IniGetWrapper;
|
||||
|
||||
foreach ($this->avatar_drivers() as $driver)
|
||||
{
|
||||
if ($driver !== 'upload')
|
||||
@@ -95,7 +104,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||
{
|
||||
$cur_avatar = $this->getMockBuilder('\phpbb\avatar\driver\\' . $driver)
|
||||
->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, $php_ini))
|
||||
->getMock();
|
||||
}
|
||||
$cur_avatar->expects($this->any())
|
||||
|
@@ -24,7 +24,7 @@
|
||||
$filesystem = new \phpbb\filesystem\filesystem();
|
||||
$phpbb_root_path = getcwd() . DIRECTORY_SEPARATOR;
|
||||
|
||||
$this->adapter = new \phpbb\storage\adapter\local($filesystem, $phpbb_root_path);
|
||||
$this->adapter = new \phpbb\storage\adapter\local($filesystem, new \FastImageSize\FastImageSize(), new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)), $phpbb_root_path);
|
||||
$this->adapter->configure(['path' => 'test_path']);
|
||||
|
||||
$this->path = $phpbb_root_path . 'test_path/';
|
||||
|
Reference in New Issue
Block a user