Skip to content

Commit

Permalink
Merge pull request #215 from hungthai1401/to_have_same_size_usage
Browse files Browse the repository at this point in the history
`toHaveSameSize` expectation usage
  • Loading branch information
nunomaduro authored Aug 23, 2023
2 parents 5d86199 + 7f972bd commit 050eac1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions expectations.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ With the Pest expectation API, you have access to an extensive collection of ind
- [`toHaveKebabCaseKeys`](#expect-toHaveKebabCaseKeys)
- [`toHaveCamelCaseKeys`](#expect-toHaveCamelCaseKeys)
- [`toHaveStudlyCaseKeys`](#expect-toHaveStudlyCaseKeys)
- [`toHaveSameSize`](#expect-toHaveSameSize)

</div>

Expand Down Expand Up @@ -797,6 +798,15 @@ This expectation ensures that `$value` only contains an array with keys in Studl
expect(['StudlyCase' => 'abc123'])->toHaveStudlyCaseKeys();
```

<a name="expect-toHaveSameSize"></a>
### `toHaveSameSize()`

This expectation ensures that the size of `$value` and the provided iterable are the same.

```php
expect(['foo', 'bar'])->toHaveSameSize(['baz', 'bazz']);
```

---

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

0 comments on commit 050eac1

Please sign in to comment.