aboutsummaryrefslogtreecommitdiffstats
path: root/tests/avatar/manager_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-01-09 23:55:22 +0100
committerMarc Alexander <admin@m-a-styles.de>2014-06-23 21:39:24 +0200
commitc22983cbdb75b687fb5d75444b0e919460dca65b (patch)
treeae6e5e79155b9f8ae88318ade42a5db169f415e5 /tests/avatar/manager_test.php
parent94a81fa01d0106f6deba6cbb9000f4c8bbbf607a (diff)
downloadforums-c22983cbdb75b687fb5d75444b0e919460dca65b.tar
forums-c22983cbdb75b687fb5d75444b0e919460dca65b.tar.gz
forums-c22983cbdb75b687fb5d75444b0e919460dca65b.tar.bz2
forums-c22983cbdb75b687fb5d75444b0e919460dca65b.tar.xz
forums-c22983cbdb75b687fb5d75444b0e919460dca65b.zip
[ticket/11148] Use mimetype guesser for uploaded avatars
PHPBB3-11148
Diffstat (limited to 'tests/avatar/manager_test.php')
-rw-r--r--tests/avatar/manager_test.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php
index 246397ad6c..97cfbfb104 100644
--- a/tests/avatar/manager_test.php
+++ b/tests/avatar/manager_test.php
@@ -42,6 +42,14 @@ class phpbb_avatar_manager_test extends \phpbb_test_case
$phpEx
);
+ $guessers = array(
+ new \Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser(),
+ new \Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser(),
+ new \phpbb\mimetype\extension_guesser,
+ new \phpbb\mimetype\content_guesser,
+ );
+ $guesser = new \phpbb\mimetype\guesser($guessers);
+
// $this->avatar_foobar will be needed later on
$this->avatar_foobar = $this->getMock('\phpbb\avatar\driver\foobar', array('get_name'), array($config, $phpbb_root_path, $phpEx, $path_helper, $cache));
$this->avatar_foobar->expects($this->any())
@@ -56,7 +64,14 @@ class phpbb_avatar_manager_test extends \phpbb_test_case
foreach ($this->avatar_drivers() as $driver)
{
- $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($config, $phpbb_root_path, $phpEx, $path_helper, $cache));
+ if ($driver !== 'upload')
+ {
+ $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($config, $phpbb_root_path, $phpEx, $path_helper, $cache));
+ }
+ else
+ {
+ $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($config, $phpbb_root_path, $phpEx, $path_helper, $guesser, $cache));
+ }
$cur_avatar->expects($this->any())
->method('get_name')
->will($this->returnValue('avatar.driver.' . $driver));