introducing toBeDigits

This commit is contained in:
AJ Meireles
2023-08-14 17:10:58 -03:00
parent 03648f580c
commit 398e3ff3b5
2 changed files with 32 additions and 0 deletions

View File

@ -502,6 +502,18 @@ final class Expectation
return $this;
}
/**
* Asserts that the value contains only digits.
*
* @return self<TValue>
*/
public function toBeDigits(string $message = ''): self
{
Assert::assertTrue(ctype_digit((string) $this->value), $message);
return $this;
}
/**
* Asserts that the value is of type object.
*