Skip to content

Commit

Permalink
[bug] Normalized test name matches int and string indexed data provid…
Browse files Browse the repository at this point in the history
…er (#68)
  • Loading branch information
flohw authored Feb 8, 2022
1 parent aec83f9 commit c976a53
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Browser/Test/BrowserExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c976a53

Please sign in to comment.