Skip to content

Commit 365bb84

Browse files
committed
feat: add assert all (multiple assert on same value)
1 parent 21c394a commit 365bb84

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Asserts.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,11 @@ public function assertArrayHasKeys(array $expectedKeys, array $actualArray, stri
5656
$this->assertArrayHasKey($key, $actualArray, $message);
5757
}
5858
}
59+
60+
public function assertAll($actual, array $assertions, array $messages = [])
61+
{
62+
foreach ($assertions as $assert => $expected) {
63+
$this->{$assert}($expected, $actual, $messages[$assert] ?? null);
64+
}
65+
}
5966
}

0 commit comments

Comments
 (0)