From be906eb823cc7d50b052ad80a42d55527bf50d36 Mon Sep 17 00:00:00 2001 From: jordanbrauer <18744334+jordanbrauer@users.noreply.github.com> Date: Sat, 13 Feb 2021 11:08:08 -0600 Subject: [PATCH] remove additional str_replace call in favour of adjusting the relative path regexp --- src/Factories/TestCaseFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Factories/TestCaseFactory.php b/src/Factories/TestCaseFactory.php index 5de5200c..f4773ce6 100644 --- a/src/Factories/TestCaseFactory.php +++ b/src/Factories/TestCaseFactory.php @@ -177,9 +177,9 @@ final class TestCaseFactory // Strip out any %-encoded octets. $relativePath = (string) preg_replace('|%[a-fA-F0-9][a-fA-F0-9]|', '', $relativePath); // Limit to A-Z, a-z, 0-9, '_', '-'. - $relativePath = (string) preg_replace('/[^A-Za-z0-9.\\\]/', '', $relativePath); + $relativePath = (string) preg_replace('/[^A-Za-z0-9\\\\]/', '', $relativePath); - $classFQN = str_replace('.', '', 'P\\' . $relativePath); + $classFQN = 'P\\' . $relativePath; if (class_exists($classFQN)) { return $classFQN; }