Skip to content

Commit

Permalink
Merge pull request #239 from tak0g/add-docs-throws-no-exceptions
Browse files Browse the repository at this point in the history
Add `throwsNoExceptions()` to exceptions
  • Loading branch information
nunomaduro authored Nov 12, 2023
2 parents 931245d + 60f371a commit 4f65b7e
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 4f65b7e

Please sign in to comment.