Skip to content

Commit

Permalink
add throwsNoExceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
tak0g committed Oct 27, 2023
1 parent 6d773b1 commit 60f371a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 60f371a

Please sign in to comment.