From bc7ff47537bae4f6db9de781cf8ba3487e28a30b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Oct 2013 12:05:00 +0200 Subject: [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 --- tests/mimetype/guesser_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') 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'); -- cgit v1.2.1