From 4579d33cc5fa3e976fb23d97892b023c59652461 Mon Sep 17 00:00:00 2001 From: AJ Meireles Date: Wed, 16 Aug 2023 13:49:45 -0300 Subject: [PATCH] introducing toBeDigits doc --- expectations.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/expectations.md b/expectations.md index a9c5914..842a05f 100644 --- a/expectations.md +++ b/expectations.md @@ -72,6 +72,7 @@ With the Pest expectation API, you have access to an extensive collection of ind - [`toBeInt()`](#expect-toBeInt) - [`toBeIterable()`](#expect-toBeIterable) - [`toBeNumeric()`](#expect-toBeNumeric) +- [`toBeDigits()`](#expect-toBeDigits) - [`toBeObject()`](#expect-toBeObject) - [`toBeResource()`](#expect-toBeResource) - [`toBeScalar()`](#expect-toBeScalar) @@ -471,6 +472,17 @@ expect(10)->toBeNumeric(); expect('10')->toBeNumeric(); ``` + +### `toBeDigits()` + +This expectation ensures that `$value` contains only digits. + +```php +expect($year)->toBeDigits(); +expect(15)->toBeDigits(); +expect('15')->toBeDigits(); +``` + ### `toBeObject()`