From c976a5367301ec5f43475dd6634409668f1055a4 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 8 Feb 2022 20:02:06 +0100 Subject: [PATCH] [bug] Normalized test name matches int and string indexed data provider (#68) --- src/Browser/Test/BrowserExtension.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Browser/Test/BrowserExtension.php b/src/Browser/Test/BrowserExtension.php index 8dadf46..1cdf88a 100644 --- a/src/Browser/Test/BrowserExtension.php +++ b/src/Browser/Test/BrowserExtension.php @@ -108,12 +108,15 @@ private static function dumpBrowsers(string $test, string $type): void private static function normalizeTestName(string $name): string { - \preg_match('#^([\w:\\\]+)(.+\#(\d+).+)?$#', $name, $matches); + // Try to match for a numeric data set index. If it didn't, match for a string one. + if (!\preg_match('#^([\w:\\\]+)(.+\#(\d+).+)?$#', $name, $matches)) { + \preg_match('#^([\w:\\\]+)(.+"([\w ]+)".+)?$#', $name, $matches); + } $normalized = \strtr($matches[1], '\\:', '-_'); if (isset($matches[3])) { - $normalized .= '__data-set-'.$matches[3]; + $normalized .= '__data-set-'.\strtr($matches[3], '\\: ', '-_-'); } return $normalized;