diff --git a/src/Utils/FileUtils.php b/src/Utils/FileUtils.php index 3e4c38c1..fec0dfd9 100644 --- a/src/Utils/FileUtils.php +++ b/src/Utils/FileUtils.php @@ -1,4 +1,5 @@ expectException(GeneralError::class); + FileUtils::safeFileOpen($nonExistingFile, 'rb'); + } + + public function testSafeFileOpenWithNonExistingFolder() + { + $nonExistingFile = 'foo/bar'; + + $this->expectException(GeneralError::class); + FileUtils::safeFileOpen($nonExistingFile, 'rb'); + } + + public function testSafeFileOpenWithEmptyPath() + { + $this->expectException(GeneralError::class); + $this->expectExceptionMessage('Path cannot be empty'); + + FileUtils::safeFileOpen('', 'rb'); + } }