From c1d644769f991604aa783f55c93984778a565eb4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 4 Feb 2015 15:24:25 +0100 Subject: [PATCH 1/2] [ticket/13577] Skip functional tests requiring fileinfo if not enabled PHPBB3-13577 --- tests/functional/download_test.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php index 4e4995c21e..1e863210e6 100644 --- a/tests/functional/download_test.php +++ b/tests/functional/download_test.php @@ -66,6 +66,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case public function test_download_accessible() { + if (!class_exists('finfo')) + { + $this->markTestSkipped('Unable to run test with fileinfo disabled'); + } + $this->load_ids(array( 'forums' => array( 'Download #1', @@ -118,6 +123,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case public function test_download_softdeleted_post() { + if (!class_exists('finfo')) + { + $this->markTestSkipped('Unable to run test with fileinfo disabled'); + } + $this->load_ids(array( 'forums' => array( 'Download #1', @@ -180,6 +190,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case public function test_download_softdeleted_topic() { + if (!class_exists('finfo')) + { + $this->markTestSkipped('Unable to run test with fileinfo disabled'); + } + $this->load_ids(array( 'forums' => array( 'Download #1', From 48b64b0a61901094668bfc8ae3db6ba1867e5e89 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 5 Feb 2015 13:37:34 +0100 Subject: [PATCH 2/2] [ticket/13577] Skip filespec test requiring mimetype check on windows PHPBB3-13577 --- tests/upload/filespec_test.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php index d8fa82e2b5..05547dcd00 100644 --- a/tests/upload/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -266,6 +266,11 @@ class phpbb_filespec_test extends phpbb_test_case */ public function test_is_image_get_mimetype($filename, $mimetype, $expected) { + if (!class_exists('finfo') && strtolower(substr(PHP_OS, 0, 3)) === 'win') + { + $this->markTestSkipped('Unable to test mimetype guessing without fileinfo support on Windows'); + } + $filespec = $this->get_filespec(array('tmp_name' => $this->path . $filename, 'type' => $mimetype)); $filespec->get_mimetype($this->path . $filename); $this->assertEquals($expected, $filespec->is_image());