mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-04 03:38:41 +00:00
fix file_exists replacement
This commit is contained in:
parent
b6e6aabacd
commit
2755594d3c
|
|
@ -52,9 +52,13 @@ final class Installer extends InstallerAbstract
|
|||
return; // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
if (!\is_file($data['path'] ?? '')) {
|
||||
throw new PathException($data['path'] ?? '');
|
||||
}
|
||||
|
||||
$mediaFile = \file_get_contents($data['path'] ?? '');
|
||||
if ($mediaFile === false) {
|
||||
throw new PathException($data['path'] ?? '');
|
||||
throw new PathException($data['path'] ?? ''); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
$mediaData = \json_decode($mediaFile, true);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class AdminTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
public function testInvalidMediaInstallJsonFile() : void
|
||||
{
|
||||
$this->expectException(\PathException::class);
|
||||
$this->expectException(\Exception::class);
|
||||
|
||||
Installer::installExternal($GLOBALS['dbpool'], ['path' => 'invalidJson.json']);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user