From 1213339cc888f7bf2515cd83f058f3577a3ce66c Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Fri, 27 Dec 2024 19:14:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20add=20gpx=20to=20extension=20map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Naming/Polyfill/FileExtensionTrait.php | 1 + tests/Naming/SmartUniqidNamerTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Naming/Polyfill/FileExtensionTrait.php b/src/Naming/Polyfill/FileExtensionTrait.php index 60536921..6e7dc84f 100644 --- a/src/Naming/Polyfill/FileExtensionTrait.php +++ b/src/Naming/Polyfill/FileExtensionTrait.php @@ -11,6 +11,7 @@ trait FileExtensionTrait // extensions safe to keep private static array $keep = [ 'txt' => 'csv', + 'xml' => 'gpx', ]; /** diff --git a/tests/Naming/SmartUniqidNamerTest.php b/tests/Naming/SmartUniqidNamerTest.php index 497de51d..0d22cd93 100644 --- a/tests/Naming/SmartUniqidNamerTest.php +++ b/tests/Naming/SmartUniqidNamerTest.php @@ -25,6 +25,7 @@ public static function fileDataProvider(): array 'dot in filename' => ['filename has . spaces (2).jpg', 'jpg', '/filename-has-spaces-2-[[:xdigit:]]{22}\.jpg/'], 'file with no extension with null mimetype' => ['lala', null, '/lala-[[:xdigit:]]{22}$/'], 'csv retains extension even if guessed as txt' => ['lala.csv', 'txt', '/lala-[[:xdigit:]]{22}\.csv/'], + 'gpx retains extension even if guessed as xml' => ['baz.gpx', 'xml', '/^baz-[[:xdigit:]]{22}\.gpx$/'], ]; }