feat: add toBeStudlyCase

This commit is contained in:
Maurizio
2023-08-17 20:49:40 +02:00
parent a76414aeee
commit 997b0e9368
2 changed files with 35 additions and 0 deletions

View File

@ -1045,4 +1045,16 @@ final class Expectation
return $this;
}
/**
* Asserts that the value is StudlyCase.
*
* @return self<TValue>
*/
public function toBeStudlyCase(string $message = ''): self
{
Assert::assertTrue((bool) preg_match('/^\p{Lu}+\p{Ll}[\p{Ll}\p{Lu}]+$/u', (string) $this->value), $message);
return $this;
}
}