Skip to content

Commit

Permalink
Merge pull request #211 from JonPurvis/extra-expectation-docs
Browse files Browse the repository at this point in the history
add documentation for toBeUppercase(), toBeLowercase(), toBeAlpha() and toBeAlphaNumeric()
  • Loading branch information
nunomaduro authored Aug 14, 2023
2 parents aacb44b + 64020d0 commit cba2969
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions expectations.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ With the Pest expectation API, you have access to an extensive collection of ind
- [`toEndWith()`](#expect-toEndWith)
- [`toMatch()`](#expect-toMatch)
- [`toMatchConstraint()`](#expect-toMatchConstraint)
- [`toBeUppercase`](#expect-toBeUppercase)
- [`toBeLowercase`](#expect-toBeLowercase)
- [`toBeAlpha`](#expect-toBeAlpha)
- [`toBeAlphaNumeric`](#expect-toBeAlphaNumeric)

</div>

Expand Down Expand Up @@ -665,6 +669,42 @@ use PHPUnit\Framework\Constraint\IsTrue;
expect(true)->toMatchConstraint(new IsTrue());
```

<a name="expect-toBeUppercase"></a>
### `toBeUppercase(string $expected)`

This expectation ensures that `$value` is uppercase.

```php
expect('PESTPHP')->toBeUppercase();
```

<a name="expect-toBeLowercase"></a>
### `toBeLowercase(string $expected)`

This expectation ensures that `$value` is lowercase.

```php
expect('pestphp')->toBeLowercase();
```

<a name="expect-toBeAlpha"></a>
### `toBeAlpha(string $expected)`

This expectation ensures that `$value` only contains alpha characters.

```php
expect('pestphp')->toBeAlpha();
```

<a name="expect-toBeAlphaNumeric"></a>
### `toBeAlphaNumeric(string $expected)`

This expectation ensures that `$value` only contains alphanumeric characters.

```php
expect('pestPHP123')->toBeAlphaNumeric();
```

---

<a name="expect-and"></a>
Expand Down

0 comments on commit cba2969

Please sign in to comment.