mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
fix: description when using ふが chars
This commit is contained in:
@ -61,7 +61,7 @@ final class Str
|
|||||||
{
|
{
|
||||||
$code = self::PREFIX.str_replace(' ', '_', $code);
|
$code = self::PREFIX.str_replace(' ', '_', $code);
|
||||||
|
|
||||||
return (string) preg_replace('/[^A-Z_a-z0-9]/', '_', $code);
|
return (string) preg_replace('/[^\p{L}_0-9]/', '_', $code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -11,3 +11,23 @@ it('may start with P', function (string $real, string $toBePrinted) {
|
|||||||
['PPPackages\Foo', 'PPPackages\Foo'],
|
['PPPackages\Foo', 'PPPackages\Foo'],
|
||||||
['PPPackages\Foo', 'PPPackages\Foo'],
|
['PPPackages\Foo', 'PPPackages\Foo'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$names = [
|
||||||
|
'ふが' => '__pest_evaluable_ふが',
|
||||||
|
'ほげ' => 'ほげ',
|
||||||
|
'卜竹弓一十山' => '卜竹弓一十山',
|
||||||
|
'!p8VrB' => '!p8VrB',
|
||||||
|
'&xe6VeKWF#n4' => '&xe6VeKWF#n4',
|
||||||
|
'%%HurHUnw7zM!' => '%%HurHUnw7zM!',
|
||||||
|
'rundeliekend' => 'rundeliekend',
|
||||||
|
'g%%c!Jt9$fy#Kf' => 'g%%c!Jt9$fy#Kf',
|
||||||
|
'NRs*Gz2@hmB$W$BPD%%b2U%3P%z%apnwSX' => 'NRs*Gz2@hmB$W$BPD%%b2U%3P%z%apnwSX',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($names as $name => $methodName) {
|
||||||
|
test($name)
|
||||||
|
->expect(fn () => static::getLatestPrintableTestCaseMethodName())
|
||||||
|
->toBe($name)
|
||||||
|
->and(fn () => $this->name())
|
||||||
|
->toBe($methodName);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user