From 9c077ed3522c7f91f8fa87157f503ae235ef142e Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 25 Jan 2024 14:13:18 +0000 Subject: [PATCH] refacto: moves function to being used on internal test suite only --- src/Functions.php | 13 ------------- tests/Pest.php | 5 +++++ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/Functions.php b/src/Functions.php index 362edf5f..34595794 100644 --- a/src/Functions.php +++ b/src/Functions.php @@ -194,16 +194,3 @@ if (! function_exists('afterAll')) { TestSuite::getInstance()->afterAll->set($closure); } } - -if (! function_exists('removeAnsiEscapeSequences')) { - /** - * Remove ANSI escape sequences from a given string. - * - * @param string $input The string containing ANSI escape sequences. - * @return string|null A new string with all ANSI escape sequences removed. - */ - function removeAnsiEscapeSequences(string $input): ?string - { - return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $input); - } -} diff --git a/tests/Pest.php b/tests/Pest.php index 71751ac4..27c64913 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -39,3 +39,8 @@ function helper_returns_string() } dataset('dataset_in_pest_file', ['A', 'B']); + +function removeAnsiEscapeSequences(string $input): ?string +{ + return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $input); +}