mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-02 23:07:39 +02:00
Merge pull request #3369 from marc1706/ticket/13577
[ticket/13577] Skip tests requiring fileinfo if not enabled
This commit is contained in:
@@ -66,6 +66,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
|
|||||||
|
|
||||||
public function test_download_accessible()
|
public function test_download_accessible()
|
||||||
{
|
{
|
||||||
|
if (!class_exists('finfo'))
|
||||||
|
{
|
||||||
|
$this->markTestSkipped('Unable to run test with fileinfo disabled');
|
||||||
|
}
|
||||||
|
|
||||||
$this->load_ids(array(
|
$this->load_ids(array(
|
||||||
'forums' => array(
|
'forums' => array(
|
||||||
'Download #1',
|
'Download #1',
|
||||||
@@ -118,6 +123,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
|
|||||||
|
|
||||||
public function test_download_softdeleted_post()
|
public function test_download_softdeleted_post()
|
||||||
{
|
{
|
||||||
|
if (!class_exists('finfo'))
|
||||||
|
{
|
||||||
|
$this->markTestSkipped('Unable to run test with fileinfo disabled');
|
||||||
|
}
|
||||||
|
|
||||||
$this->load_ids(array(
|
$this->load_ids(array(
|
||||||
'forums' => array(
|
'forums' => array(
|
||||||
'Download #1',
|
'Download #1',
|
||||||
@@ -180,6 +190,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
|
|||||||
|
|
||||||
public function test_download_softdeleted_topic()
|
public function test_download_softdeleted_topic()
|
||||||
{
|
{
|
||||||
|
if (!class_exists('finfo'))
|
||||||
|
{
|
||||||
|
$this->markTestSkipped('Unable to run test with fileinfo disabled');
|
||||||
|
}
|
||||||
|
|
||||||
$this->load_ids(array(
|
$this->load_ids(array(
|
||||||
'forums' => array(
|
'forums' => array(
|
||||||
'Download #1',
|
'Download #1',
|
||||||
|
@@ -266,6 +266,11 @@ class phpbb_filespec_test extends phpbb_test_case
|
|||||||
*/
|
*/
|
||||||
public function test_is_image_get_mimetype($filename, $mimetype, $expected)
|
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 = $this->get_filespec(array('tmp_name' => $this->path . $filename, 'type' => $mimetype));
|
||||||
$filespec->get_mimetype($this->path . $filename);
|
$filespec->get_mimetype($this->path . $filename);
|
||||||
$this->assertEquals($expected, $filespec->is_image());
|
$this->assertEquals($expected, $filespec->is_image());
|
||||||
|
Reference in New Issue
Block a user