Skip to content

Commit

Permalink
docs: adds toContainEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro authored Jan 25, 2024
1 parent 8c02ca6 commit 2dd74b9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions expectations.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ With the Pest expectation API, you have access to an extensive collection of ind
- [`toBeLessThan()`](#expect-toBeLessThan)
- [`toBeLessThanOrEqual()`](#expect-toBeLessThanOrEqual)
- [`toContain()`](#expect-toContain)
- [`toContainEqual()`](#expect-toContainEqual)
- [`toContainOnlyInstancesOf()`](#expect-toContainOnlyInstancesOf)
- [`toHaveCount()`](#expect-toHaveCount)
- [`toHaveMethod()`](#expect-toHaveMethod)
Expand Down Expand Up @@ -258,6 +259,17 @@ expect('Pest: an elegant PHP Testing Framework')->toContain('Pest', 'PHP', 'Fram
expect([1, 2, 3, 4])->toContain(2, 4);
```


<a name="expect-toContainEqual"></a>
### `toContainEqual($needles)`

This expectation ensures that all the given needles are elements (in terms of equality) of the `$value`.

```php
expect([1, 2, 3])->toContainEqual('1');
expect([1, 2, 3])->toContainEqual('1', '2');
```

<a name="expect-toContainOnlyInstancesOf"></a>
### `toContainOnlyInstancesOf($class)`

Expand Down

0 comments on commit 2dd74b9

Please sign in to comment.