PHPackages                             cspray/assert-throws - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. cspray/assert-throws

ActiveLibrary[Testing &amp; Quality](/categories/testing)

cspray/assert-throws
====================

Assertions for PHPUnit when testing code that throws complex exceptions.

0.2.0(1y ago)7224[4 issues](https://github.com/cspray/assert-throws/issues)MITPHPPHP ^8.2CI failing

Since May 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/cspray/assert-throws)[ Packagist](https://packagist.org/packages/cspray/assert-throws)[ RSS](/packages/cspray-assert-throws/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

cspray/assert-throws
====================

[](#csprayassert-throws)

Provides an alternative way to test code that throws exceptions using PHPUnit 10 or 11. The primary benefit being access to the thrown Exception for further inspection. This might prove useful when you need to check for details of an exception that aren't available to be expected in PHPUnit. The below example acts as a Quick Start, for more details check out the [Detailed Guide](#Detailed-Guide) below.

```
