File getMimeType throws exception if no mime type can be set, fixes for phpstan checks

This commit is contained in:
Clemens Schwaighofer
2026-05-11 15:55:33 +09:00
parent 116f0a770c
commit 1823fd369b
14 changed files with 79 additions and 32 deletions
@@ -277,6 +277,38 @@ final class CoreLibsConvertJsonTest extends TestCase
);
}
/**
* Check if invalid flag throws exception
*
* @covers ::jsonValidate
* @testdox jsonValidate test exception thrown on invalid flag
*
* @return void
*/
public function testJsonValidateInvalidFlag(): void
{
$this->expectException("\InvalidArgumentException");
\CoreLibs\Convert\Json::jsonValidate('{"valid": "json"}', 5);
}
/**
* Check if valid flag throws no exception
*
* @covers ::jsonValidate
* @testdox jsonValidate test no exception on valid flag
*
* @return void
*/
public function testJsonValidateValidflag(): void
{
$this->assertTrue(
\CoreLibs\Convert\Json::jsonValidate('{"valid": "json"}', 0)
);
$this->assertTrue(
\CoreLibs\Convert\Json::jsonValidate('{"valid": "json"}', JSON_INVALID_UTF8_IGNORE)
);
}
/**
* Undocumented function
*