PHPackages                             codeception/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. codeception/assert-throws

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

codeception/assert-throws
=========================

Assert exception was thrown without stopping a test

1.6.0(1w ago)191.9M↓45.4%11[1 issues](https://github.com/Codeception/AssertThrows/issues)[1 PRs](https://github.com/Codeception/AssertThrows/pulls)20MITPHPCI failing

Since Feb 9Pushed 1y ago5 watchersCompare

[ Source](https://github.com/Codeception/AssertThrows)[ Packagist](https://packagist.org/packages/codeception/assert-throws)[ RSS](/packages/codeception-assert-throws/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (20)

AssertThrows
============

[](#assertthrows)

Handle exceptions inside a test without a stop! Works with **PHPUnit** and Codeception.

[![Actions Status](https://github.com/Codeception/AssertThrows/workflows/CI/badge.svg)](https://github.com/Codeception/AssertThrows/actions)[![Latest Stable Version](https://camo.githubusercontent.com/2f897289b9e43cf3f07d35424bc166b9a033e8d85ccf4357f5396da649ad2fa0/68747470733a2f2f706f7365722e707567782e6f72672f636f646563657074696f6e2f4173736572742d5468726f77732f762f737461626c65)](https://github.com/Codeception/AssertThrows/releases)[![Total Downloads](https://camo.githubusercontent.com/b314470cabc8e93799aa98da4bbc47387a8b11acefacc3364603dfbfa5bcc37c/68747470733a2f2f706f7365722e707567782e6f72672f636f646563657074696f6e2f4173736572742d5468726f77732f646f776e6c6f616473)](https://packagist.org/packages/codeception/Assert-Throws)[![License](https://camo.githubusercontent.com/8c37d488b702393e4a32733ec4bab665cd29089667824a3859c77d33c34a2102/68747470733a2f2f706f7365722e707567782e6f72672f636f646563657074696f6e2f4173736572742d5468726f77732f6c6963656e7365)](/LICENSE)

Installation
------------

[](#installation)

```
composer require "codeception/assert-throws" --dev

```

Include `AssertThrows` trait it to a TestCase:

```
