From 60f371add4c8cf5a6e4bae7b6b3ed2c76460510a Mon Sep 17 00:00:00 2001 From: tak0g Date: Fri, 27 Oct 2023 22:37:15 +0900 Subject: [PATCH] add throwsNoExceptions --- exceptions.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/exceptions.md b/exceptions.md index d8d867b..ce2a8bf 100644 --- a/exceptions.md +++ b/exceptions.md @@ -53,6 +53,14 @@ it('throws exception', function () { }); ``` +If you expect no exceptions to be thrown, you can use the `throwsNoExceptions()` method. + +```php +it('throws no exceptions', function () { + $result = 1 + 1; +})->throwsNoExceptions(); +``` + --- After learning how to write tests that assert exceptions, the next step is to explore "Test Filtering". This feature allows you to efficiently run specific tests based on criteria like test name, dirty files, and more: [Filtering Tests →](/docs/filtering-tests)