diff --git a/src/Component/Utils.php b/src/Component/Utils.php index 9275375..320b158 100644 --- a/src/Component/Utils.php +++ b/src/Component/Utils.php @@ -28,7 +28,7 @@ class Utils */ public static function removeVersionFromUri(string $uri): string { - return (string) preg_replace('/\/v\d{1,3}\/?/', '', $uri); + return (string) preg_replace('#api/v\d{1,3}/?#', 'api', $uri); } /** diff --git a/tests/src/Component/UtilsTest.php b/tests/src/Component/UtilsTest.php new file mode 100644 index 0000000..af4e024 --- /dev/null +++ b/tests/src/Component/UtilsTest.php @@ -0,0 +1,37 @@ +