mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat: add toBeKebabCase
This commit is contained in:
@ -1021,4 +1021,16 @@ final class Expectation
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that the value is kebab-case.
|
||||
*
|
||||
* @return self<TValue>
|
||||
*/
|
||||
public function toBeKebabCase(string $message = ''): self
|
||||
{
|
||||
Assert::assertTrue((bool) preg_match('/^[\p{Ll}-]+$/u', (string) $this->value), $message);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user