aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mimetype
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-10-24 12:05:00 +0200
committerMarc Alexander <admin@m-a-styles.de>2013-10-24 12:05:00 +0200
commitbc7ff47537bae4f6db9de781cf8ba3487e28a30b (patch)
tree8cb137952d6b138c19e63f435c462cd93e091e5b /tests/mimetype
parent24099583a32608c2350bdb10d018d6c8a0551e6c (diff)
downloadforums-bc7ff47537bae4f6db9de781cf8ba3487e28a30b.tar
forums-bc7ff47537bae4f6db9de781cf8ba3487e28a30b.tar.gz
forums-bc7ff47537bae4f6db9de781cf8ba3487e28a30b.tar.bz2
forums-bc7ff47537bae4f6db9de781cf8ba3487e28a30b.tar.xz
forums-bc7ff47537bae4f6db9de781cf8ba3487e28a30b.zip
[ticket/11912] Supply filename to content_guesser for guessing on windows
The filename of the files sent to the guesser by plupload do not contain the file extension. Therefore, it's impossible to guess the mimetype if only the content_guesser is available and the function mime_content_type() doesn't exist. By supplying the filename we can circumvent this issue. PHPBB3-11912
Diffstat (limited to 'tests/mimetype')
-rw-r--r--tests/mimetype/guesser_test.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/mimetype/guesser_test.php b/tests/mimetype/guesser_test.php
index 6484606210..9d4d965d63 100644
--- a/tests/mimetype/guesser_test.php
+++ b/tests/mimetype/guesser_test.php
@@ -119,8 +119,9 @@ class guesser_test extends \phpbb_test_case
public function test_content_guesser($expected, $overload = false)
{
self::$function_exists = ($overload) ? false : true;
- $guesser = new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\content_guesser($this->phpbb_root_path, new \phpbb\php\ini)));
+ $guesser = new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\content_guesser));
$this->assertEquals($expected[0], $guesser->guess($this->jpg_file));
+ $this->assertEquals($expected[1], $guesser->guess($this->jpg_file, $this->jpg_file . '.jpg'));
@copy($this->jpg_file, $this->jpg_file . '.jpg');
$this->assertEquals($expected[1], $guesser->guess($this->jpg_file . '.jpg'));
@unlink($this->jpg_file . '.jpg');