From 12c6920b6804f755d8c45335225bb8e1ec6a3f7f Mon Sep 17 00:00:00 2001 From: Mantas Date: Tue, 6 Feb 2024 13:31:22 +0200 Subject: [PATCH] Ignore XML parsing warnings --- src/Code/Converters/TtmlConverter.php | 2 +- tests/formats/TtmlTest.php | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Code/Converters/TtmlConverter.php b/src/Code/Converters/TtmlConverter.php index 1e38b4d..2771765 100644 --- a/src/Code/Converters/TtmlConverter.php +++ b/src/Code/Converters/TtmlConverter.php @@ -33,7 +33,7 @@ public function fileContentToInternalFormat($file_content, $original_file_conten $new_file_content = str_replace("encoding='UTF-16'", "encoding='UTF-8'", $new_file_content); return (new TtmlConverter())->fileContentToInternalFormat($new_file_content, ''); } - throw new UserException('Invalid XML: ' . trim($errors[0]->message)); + // throw new UserException('Invalid XML: ' . trim($errors[0]->message)); } $fps = self::framesPerSecond($file_content); diff --git a/tests/formats/TtmlTest.php b/tests/formats/TtmlTest.php index f7cf0af..095bc6a 100644 --- a/tests/formats/TtmlTest.php +++ b/tests/formats/TtmlTest.php @@ -76,8 +76,6 @@ public function testParses2() public function testDuplicatedElementIdsParse() { - $this->expectException(UserException::class); - $ttml_path = './tests/files/ttml_with_duplicated_element_ids.ttml'; $actual = Subtitles::loadFromFile($ttml_path)->getInternalFormat(); $expected = (new Subtitles()) @@ -90,8 +88,6 @@ public function testDuplicatedElementIdsParse() public function testTimeParseWithFpsAndMultiplierGiven() { - $this->expectException(UserException::class); - $ttml_path = './tests/files/ttml_with_fps_and_multiplier_given.ttml'; $actual = Subtitles::loadFromFile($ttml_path)->getInternalFormat(); $expected = (new Subtitles())