mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
using php documentation regex
This commit is contained in:
@ -61,7 +61,8 @@ final class Str
|
|||||||
{
|
{
|
||||||
$code = self::PREFIX.str_replace(' ', '_', $code);
|
$code = self::PREFIX.str_replace(' ', '_', $code);
|
||||||
|
|
||||||
return (string) preg_replace('/[^\p{L}_0-9]/', '_', $code);
|
// sticks to PHP8.2 function naming rules https://www.php.net/manual/en/functions.user-defined.php
|
||||||
|
return (string) preg_replace('/[^a-zA-Z0-9_\x80-\xff]/', '_', $code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -14,14 +14,15 @@ it('may start with P', function (string $real, string $toBePrinted) {
|
|||||||
|
|
||||||
$names = [
|
$names = [
|
||||||
'ふが' => '__pest_evaluable_ふが',
|
'ふが' => '__pest_evaluable_ふが',
|
||||||
'ほげ' => 'ほげ',
|
'ほげ' => '__pest_evaluable_ほげ',
|
||||||
'卜竹弓一十山' => '卜竹弓一十山',
|
'卜竹弓一十山' => '__pest_evaluable_卜竹弓一十山',
|
||||||
'!p8VrB' => '!p8VrB',
|
'!p8VrB' => '__pest_evaluable__p8VrB',
|
||||||
'&xe6VeKWF#n4' => '&xe6VeKWF#n4',
|
'&xe6VeKWF#n4' => '__pest_evaluable__xe6VeKWF_n4',
|
||||||
'%%HurHUnw7zM!' => '%%HurHUnw7zM!',
|
'%%HurHUnw7zM!' => '__pest_evaluable___HurHUnw7zM_',
|
||||||
'rundeliekend' => 'rundeliekend',
|
'rundeliekend' => '__pest_evaluable_rundeliekend',
|
||||||
'g%%c!Jt9$fy#Kf' => 'g%%c!Jt9$fy#Kf',
|
'g%%c!Jt9$fy#Kf' => '__pest_evaluable_g__c_Jt9_fy_Kf',
|
||||||
'NRs*Gz2@hmB$W$BPD%%b2U%3P%z%apnwSX' => 'NRs*Gz2@hmB$W$BPD%%b2U%3P%z%apnwSX',
|
'NRs*Gz2@hmB$W$BPD%%b2U%3P%z%apnwSX' => '__pest_evaluable_NRs_Gz2_hmB_W_BPD__b2U_3P_z_apnwSX',
|
||||||
|
'ÀĤ{¼' => '__pest_evaluable_ÀĤ_¼',
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($names as $name => $methodName) {
|
foreach ($names as $name => $methodName) {
|
||||||
|
|||||||
Reference in New Issue
Block a user