1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-31 22:15:31 +01:00

[ticket/13904] Modify files for updated fast-image-size library

PHPBB3-13904
This commit is contained in:
Marc Alexander 2015-09-09 09:41:40 +02:00
parent 223fa3aed5
commit 327e36a4d6
9 changed files with 19 additions and 19 deletions

View File

@ -75,7 +75,7 @@ class filespec
/** @var \bantu\IniGetWrapper\IniGetWrapper ini_get() wrapper class */
protected $php_ini;
/** @var \fastImageSize\fastImageSize */
/** @var \FastImageSize\FastImageSize */
protected $imagesize;
/** @var language Language class */
@ -96,12 +96,12 @@ class filespec
* @param \phpbb\filesystem\filesystem_interface $phpbb_filesystem Filesystem
* @param language $language Language
* @param \bantu\IniGetWrapper\IniGetWrapper $php_ini ini_get() wrapper
* @param \fastImageSize\fastImageSize $imagesize Imagesize class
* @param \FastImageSize\FastImageSize $imagesize Imagesize class
* @param string $phpbb_root_path phpBB root path
* @param \phpbb\mimetype\guesser $mimetype_guesser Mime type guesser
* @param \phpbb\plupload\plupload $plupload Plupload
*/
public function __construct(\phpbb\filesystem\filesystem_interface $phpbb_filesystem, language $language, \bantu\IniGetWrapper\IniGetWrapper $php_ini, \fastImageSize\fastImageSize $imagesize, $phpbb_root_path, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
public function __construct(\phpbb\filesystem\filesystem_interface $phpbb_filesystem, language $language, \bantu\IniGetWrapper\IniGetWrapper $php_ini, \FastImageSize\FastImageSize $imagesize, $phpbb_root_path, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
{
$this->filesystem = $phpbb_filesystem;
$this->language = $language;

View File

@ -50,7 +50,7 @@ class phpbb_files_types_base_test extends phpbb_test_case
$this->filesystem,
$this->language,
$this->php_ini,
new \fastImageSize\fastImageSize(),
new \FastImageSize\FastImageSize(),
$phpbb_root_path,
new \phpbb\mimetype\guesser(array(
'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(),

View File

@ -58,7 +58,7 @@ class phpbb_files_types_form_test extends phpbb_test_case
$this->filesystem,
$this->language,
$this->php_ini,
new \fastImageSize\fastImageSize(),
new \FastImageSize\FastImageSize(),
$phpbb_root_path,
new \phpbb\mimetype\guesser(array(
'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(),
@ -147,7 +147,7 @@ class phpbb_files_types_form_test extends phpbb_test_case
$this->filesystem,
$this->language,
$this->php_ini,
new \fastImageSize\fastImageSize(),
new \FastImageSize\FastImageSize(),
$this->phpbb_root_path,
new \phpbb\mimetype\guesser(array(
'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(),

View File

@ -58,7 +58,7 @@ class phpbb_files_types_local_test extends phpbb_test_case
$this->filesystem,
$this->language,
$this->php_ini,
new \fastImageSize\fastImageSize(),
new \FastImageSize\FastImageSize(),
$phpbb_root_path,
new \phpbb\mimetype\guesser(array(
'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(),
@ -139,7 +139,7 @@ class phpbb_files_types_local_test extends phpbb_test_case
$this->filesystem,
$this->language,
$this->php_ini,
new \fastImageSize\fastImageSize(),
new \FastImageSize\FastImageSize(),
$this->phpbb_root_path,
new \phpbb\mimetype\guesser(array(
'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(),

View File

@ -54,7 +54,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case
$this->filesystem,
$this->language,
$this->php_ini,
new \fastImageSize\fastImageSize(),
new \FastImageSize\FastImageSize(),
$phpbb_root_path,
new \phpbb\mimetype\guesser(array(
'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(),

View File

@ -59,7 +59,7 @@ class phpbb_files_upload_test extends phpbb_test_case
$this->filesystem,
$this->language,
$this->php_ini,
new \fastImageSize\fastImageSize(),
new \FastImageSize\FastImageSize(),
$phpbb_root_path,
new \phpbb\mimetype\guesser(array(
'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(),

View File

@ -57,7 +57,7 @@ class phpbb_functional_fileupload_remote_test extends phpbb_functional_test_case
$this->php_ini = new \bantu\IniGetWrapper\IniGetWrapper;
$container = new phpbb_mock_container_builder();
$container->set('files.filespec', new \phpbb\files\filespec($this->filesystem, $this->language, $this->php_ini, new \fastImageSize\fastImageSize(), $this->phpbb_root_path));
$container->set('files.filespec', new \phpbb\files\filespec($this->filesystem, $this->language, $this->php_ini, new \FastImageSize\FastImageSize(), $this->phpbb_root_path));
$this->factory = new \phpbb\files\factory($container);
$container->set('files.factory', $this->factory);
$container->set('files.types.remote', new \phpbb\files\types\remote($this->factory, $this->language, $this->php_ini, $this->request, $phpbb_root_path));

View File

@ -93,7 +93,7 @@ class phpbb_filespec_test extends phpbb_test_case
'error' => '',
);
$filespec = new \phpbb\files\filespec($this->filesystem, $this->language, new \bantu\IniGetWrapper\IniGetWrapper, new \fastImageSize\fastImageSize(), $this->phpbb_root_path, $this->mimetype_guesser);
$filespec = new \phpbb\files\filespec($this->filesystem, $this->language, new \bantu\IniGetWrapper\IniGetWrapper, new \FastImageSize\FastImageSize(), $this->phpbb_root_path, $this->mimetype_guesser);
return $filespec->set_upload_ary(array_merge($upload_ary, $override));
}
@ -114,7 +114,7 @@ class phpbb_filespec_test extends phpbb_test_case
public function test_empty_upload_ary()
{
$filespec = new \phpbb\files\filespec($this->filesystem, $this->language, new \bantu\IniGetWrapper\IniGetWrapper, new \fastImageSize\fastImageSize(), $this->phpbb_root_path, $this->mimetype_guesser);
$filespec = new \phpbb\files\filespec($this->filesystem, $this->language, new \bantu\IniGetWrapper\IniGetWrapper, new \FastImageSize\FastImageSize(), $this->phpbb_root_path, $this->mimetype_guesser);
$this->assertInstanceOf('\phpbb\files\filespec', $filespec->set_upload_ary(array()));
$this->assertTrue($filespec->init_error());
}
@ -262,7 +262,7 @@ class phpbb_filespec_test extends phpbb_test_case
*/
public function test_clean_filename_avatar($filename, $expected, $mode, $prefix = '', $user_id = '')
{
$filespec = new \phpbb\files\filespec($this->filesystem, $this->language, new \bantu\IniGetWrapper\IniGetWrapper, new \fastImageSize\fastImageSize(), $this->phpbb_root_path, $this->mimetype_guesser);
$filespec = new \phpbb\files\filespec($this->filesystem, $this->language, new \bantu\IniGetWrapper\IniGetWrapper, new \FastImageSize\FastImageSize(), $this->phpbb_root_path, $this->mimetype_guesser);
if ($filename)
{
@ -435,7 +435,7 @@ class phpbb_filespec_test extends phpbb_test_case
->willReturn($safe_mode_on);
$upload = new phpbb_mock_fileupload();
$upload->max_filesize = self::UPLOAD_MAX_FILESIZE;
$filespec = new \phpbb\files\filespec($this->filesystem, $this->language, $php_ini, new \fastImageSize\fastImagesize, '', $this->mimetype_guesser);
$filespec = new \phpbb\files\filespec($this->filesystem, $this->language, $php_ini, new \FastImageSize\FastImagesize, '', $this->mimetype_guesser);
$filespec->set_upload_ary($upload_ary);
$filespec->local = false;
$filespec->extension = 'gif';
@ -494,7 +494,7 @@ class phpbb_filespec_test extends phpbb_test_case
'error' => '',
);
$imagesize = $this->getMockBuilder('\fastImageSize\fastImageSize')
$imagesize = $this->getMockBuilder('\FastImageSize\FastImageSize')
->getMock();
$imagesize->expects($this->any())
->method('getImageSize')
@ -530,7 +530,7 @@ class phpbb_filespec_test extends phpbb_test_case
public function test_is_uploaded()
{
$filespec = new \phpbb\files\filespec($this->filesystem, $this->language, new \bantu\IniGetWrapper\IniGetWrapper, new \fastImageSize\fastImageSize(), $this->phpbb_root_path, null);
$filespec = new \phpbb\files\filespec($this->filesystem, $this->language, new \bantu\IniGetWrapper\IniGetWrapper, new \FastImageSize\FastImageSize(), $this->phpbb_root_path, null);
$reflection_filespec = new ReflectionClass($filespec);
$plupload_property = $reflection_filespec->getProperty('plupload');
$plupload_property->setAccessible(true);

View File

@ -72,7 +72,7 @@ class phpbb_fileupload_test extends phpbb_test_case
$this->filesystem,
$this->language,
$this->php_ini,
new \fastImageSize\fastImageSize(),
new \FastImageSize\FastImageSize(),
$phpbb_root_path,
new \phpbb\mimetype\guesser(array(
'mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser(),
@ -132,7 +132,7 @@ class phpbb_fileupload_test extends phpbb_test_case
$upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path);
$upload->set_allowed_extensions(array('jpg'))
->set_max_filesize(1000);
$file = new \phpbb\files\filespec($this->filesystem, $this->language, $this->php_ini, new \fastImageSize\fastImageSize(), $this->phpbb_root_path);
$file = new \phpbb\files\filespec($this->filesystem, $this->language, $this->php_ini, new \FastImageSize\FastImageSize(), $this->phpbb_root_path);
$file->set_upload_ary(array(
'size' => 50,
'tmp_name' => dirname(__FILE__) . '/fixture/disallowed',