Registry / testing / vladahejda-phpunit-assert-exception

vladahejda-phpunit-assert-exception

JSON →
library1.3.0phppackagistunverified

Assert exception/throwable/error PHPUnit trait.

composer require vladahejda/phpunit-assert-exception
INSTALL
IMPORT
SIG · VLADAHEJDA-PHPUNIT
V
vladahejda-phpunit-assert-exception
testingphpv1.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AssertException
use VladaHejda\PhpUnitAssertException\AssertException;

Provides a trait to assert exceptions in PHPUnit tests.

use VladaHejda\PhpUnitAssertException\AssertException; class MyTest extends \PHPUnit\Framework\TestCase { use AssertException; public function testException() { $this->assertException(\InvalidArgumentException::class, function() { throw new \InvalidArgumentException(); }); } }
Debug
Known issues
breakingOnly works with PHPUnit 8+ and may conflict with other exception assertion methods.
fix
Ensure PHPUnit version compatibility and avoid using other exception assertion traits.
affects: >=1.3.0
Upgrade
Version history
1.3.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
vladahejda-phpunit-assert-exception — pip install vladahejda-phpunit-assert-exception · libregistry