mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
refacto: moves function to being used on internal test suite only
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user