aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mimetype
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-11-23 01:19:43 +0100
committerMarc Alexander <admin@m-a-styles.de>2013-11-23 01:19:43 +0100
commitc9c419c4317ddd12b49082368e245f881a001610 (patch)
treed5860415d1d310286285a3c930947e268588831b /tests/mimetype
parent943ab555da799fd94b221d5cd0a82fce568de042 (diff)
downloadforums-c9c419c4317ddd12b49082368e245f881a001610.tar
forums-c9c419c4317ddd12b49082368e245f881a001610.tar.gz
forums-c9c419c4317ddd12b49082368e245f881a001610.tar.bz2
forums-c9c419c4317ddd12b49082368e245f881a001610.tar.xz
forums-c9c419c4317ddd12b49082368e245f881a001610.zip
[ticket/11912] Expect logic exceptions in test if no guesser available
PHPBB3-11912
Diffstat (limited to 'tests/mimetype')
-rw-r--r--tests/mimetype/guesser_test.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/mimetype/guesser_test.php b/tests/mimetype/guesser_test.php
index 2c1a35544f..9f0371262b 100644
--- a/tests/mimetype/guesser_test.php
+++ b/tests/mimetype/guesser_test.php
@@ -127,7 +127,20 @@ class guesser_test extends \phpbb_test_case
*/
public function test_content_guesser($expected, $guessers, $overload = false)
{
+ $supported = false;
self::$function_exists = !$overload;
+
+ // Cover possible LogicExceptions
+ foreach ($guessers as $cur_guesser)
+ {
+ $supported += $cur_guesser->is_supported();
+ }
+
+ if (!$supported)
+ {
+ $this->setExpectedException('\LogicException');
+ }
+
$guesser = new \phpbb\mimetype\guesser($guessers);
$this->assertEquals($expected[0], $guesser->guess($this->jpg_file));
$this->assertEquals($expected[1], $guesser->guess($this->jpg_file, $this->jpg_file . '.jpg'));