feat: add toBeKebabCase

This commit is contained in:
Maurizio
2023-08-17 20:48:51 +02:00
parent 4951b1b0f9
commit d2096df82a
2 changed files with 35 additions and 0 deletions

View File

@ -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;
}
}