From 2dd74b97bdfc616d77164bce5123db9102fe996d Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 25 Jan 2024 14:41:38 +0000 Subject: [PATCH] docs: adds `toContainEqual` --- expectations.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/expectations.md b/expectations.md index 8925557..e01da1f 100644 --- a/expectations.md +++ b/expectations.md @@ -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) @@ -258,6 +259,17 @@ expect('Pest: an elegant PHP Testing Framework')->toContain('Pest', 'PHP', 'Fram expect([1, 2, 3, 4])->toContain(2, 4); ``` + + +### `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'); +``` + ### `toContainOnlyInstancesOf($class)`