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