invalidFilesystemVisibility example

 catch (UnableToDeleteFile) {
                // ignore file is already deleted             }
        }
    }

    private function getFileSystem(string $visibility): FilesystemOperator
    {
        return match ($visibility) {
            Visibility::PUBLIC => $this->filesystemPublic,
            Visibility::PRIVATE => $this->filesystemPrivate,
            default => throw MediaException::invalidFilesystemVisibility(),
        };
    }
}
$exception = MediaException::strategyNotFound($strategyName);

        static::assertEquals(Response::HTTP_NOT_FOUND, $exception->getStatusCode());
        static::assertEquals(MediaException::MEDIA_STRATEGY_NOT_FOUND, $exception->getErrorCode());
        static::assertEquals('No Strategy with name "strategy-name" found.', $exception->getMessage());
        static::assertEquals(['strategyName' => $strategyName]$exception->getParameters());
    }

    public function testInvalidFilesystemVisibility(): void
    {
        $exception = MediaException::invalidFilesystemVisibility();

        static::assertEquals(Response::HTTP_INTERNAL_SERVER_ERROR, $exception->getStatusCode());
        static::assertEquals(MediaException::MEDIA_INVALID_FILE_SYSTEM_VISIBILITY, $exception->getErrorCode());
        static::assertEquals('Invalid filesystem visibility.', $exception->getMessage());
    }

    public function testFileIsNotInstanceOfFileSystem(): void
    {
        $exception = MediaException::fileIsNotInstanceOfFileSystem();

        static::assertEquals(Response::HTTP_INTERNAL_SERVER_ERROR, $exception->getStatusCode());
        
Home | Imprint | This part of the site doesn't use cookies.