jchook/phpunit-assert-throws
A PHPUnit assertion helper for testing that code throws exceptions. It adds assertThrows to verify exception types and messages in a single call, keeping tests compact and readable while confirming the expected error is actually raised.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| codeception/assert-throws | 0.85 | Assert that a callable throws the expected exception without try/catch boilerplate. codeception/assert-throws adds assertThrows and assertDoesNotThrow helpers for Codeception and PHPUnit tests, with clear failure messages and optional checks on exception class and message. | 19 | 19 | 11 | 26K | 1 | 15.8 | 47.6 | MIT | 5 months ago | |
| eliashaeussler/phpunit-attributes | 0.85 | PHPUnit Attributes adds modern PHP 8 attributes to define PHPUnit tests, data providers, groups, dependencies and more in a clean, declarative way. Keep test classes readable and reduce annotation/docblock noise while staying compatible with PHPUnit workflows. | 4 | 4 | 1 | 4K | 1 | 11.5 | 43.3 | GPL-3.0 | 7 months ago | |
| helmich/phpunit-json-assert | 0.85 | Adds concise JSON assertions to PHPUnit using JSONPath expressions and JSON Schema validation. Use the JsonAssertions trait to verify complex JSON/data structures with readable assert* helpers. Install via Composer and choose the branch matching your PHPUnit/PHP version. | 130 | 130 | 27 | 92K | 3 | 10.8 | 42.3 | MIT | 8 months ago | |
| hamcrest/hamcrest-php | 0.85 | Official PHP port of Hamcrest, the matching library originally written for Java. Provides readable matchers like equalTo, containsString and is for expressive assertions in PHP tests, with global proxy functions and MatcherAssert support. | 6,981 | 7,014 | 47 | 11M | 10 | 44.1 | 53.7 | NOASSERTION | 4 months ago | |
| php-mock/php-mock-phpunit | 0.84 | Integrate php-mock with PHPUnit to mock built-in PHP functions (like time(), file_get_contents(), etc.) in a controlled, namespaced way. Ideal for unit tests that need to simulate IO, time, and other global behaviors without changing production code. | 173 | 176 | 20 | 236K | 4 | 28.3 | 51.3 | WTFPL | 1 month ago | |
| php-mock/php-mock-integration | 0.84 | Integration layer for php-mock, making it easy to use PHP function mocks within popular test frameworks. Helps you stub built-in functions like time(), rand(), and file operations in specific namespaces, enabling reliable, isolated unit tests without touching global state. | 14 | 14 | 6 | 374K | 0 | 8.2 | 57.8 | WTFPL | 9 months ago | |
| phpunit/phpunit-mock-objects | 0.84 | Default mock object library for PHPUnit. Create test doubles (mocks, stubs, spies) to isolate units under test, define expectations, control method returns, and verify interactions. Designed for PHPUnit projects and compatible with PHP 7.1+. | 4,920 | 5,056 | 151 | 759K | 0 | 15.2 | 21.4 | NOASSERTION | 13 years ago | |
| mnapoli/phpunit-easymock | 0.84 | A lightweight bridge between PHPUnit and EasyMock for PHP. Quickly create, replay, and verify mocks from your test cases with minimal boilerplate, helping you write clear unit tests using the familiar EasyMock-style workflow. | 38 | 38 | 4 | 1K | 0 | 4.8 | 20.6 | MIT | 1 year ago | |
| testo/assert | 0.84 | Assertion plugin for the Testo PHP testing framework. Adds a fluent assert/expect facade, expectation lifecycle, and helpers for matching thrown exceptions. Reports comparisons through Testo’s standard pipeline. Install via Composer: testo/assert. | 0 | 0 | 0 | 16K | 0 | 0.0 | 55.3 | — | — | |
| bovigo/assert | 0.84 | Functional-style assertions for PHP unit tests. Use assertThat(value, predicate[, description]) for readable checks with helpful failure messages. Integrates with PHPUnit via AssertionFailure extending AssertionFailedError. Requires PHP 8.3+. | 13 | 13 | 5 | 724 | 1 | 11.5 | 24.9 | BSD-3-Clause | 11 months ago | |
| way/phpunit-wrappers | 0.84 | way/phpunit-wrappers provides lightweight PHPUnit wrapper utilities for Laravel and PHP projects, helping you write cleaner, more readable tests with less boilerplate. Use it to simplify assertions, test setup, and common testing patterns without changing your existing PHPUnit workflow. | 45 | 47 | 2 | 66 | 0 | 0.3 | 5.3 | — | — | |
| lendable/phpunit-extensions | 0.84 | — | 2 | 2 | 0 | 2K | 1 | 8.6 | 43.2 | MIT | 8 months ago | |
| herrera-io/phpunit-test-case | 0.84 | PHPUnit TestCase class and Extras trait that add helpers for common test chores: create/delete temporary files and directories, call protected/private methods, and get/set protected/private properties. Use as a base class or mix into your own test case. | 1 | 1 | 0 | 32 | 0 | 0.0 | 12.0 | MIT | — | |
| draw/tester | 0.84 | Tools for testing PHP apps: DataTester wraps PHPUnit assertions with a fluent, path-based API for arrays/objects. Includes PHPUnit extensions like CarbonReset to reset Carbon state between tests and SetUpAutowire to autowire test properties via attributes. | 0 | 0 | 0 | 1K | 0 | 0.0 | 43.0 | MIT | — | |
| codeception/stub | 0.84 | Create lightweight test doubles for PHP with Codeception Stub. Quickly generate stubs and mocks, define method returns and expectations, and override behavior on the fly—ideal for unit tests that need fast, flexible objects without full implementations. | 301 | 302 | 19 | 1M | 7 | 22.0 | 57.4 | MIT | 9 months ago | |
| robiningelbrecht/phpunit-pretty-print | 0.84 | A PHPUnit result printer that transforms default test output into clean, colorful, readable reports. See progress, failures, and timing at a glance, with less noise and more useful detail during every test run. Easy to install and configure via phpunit.xml. | 77 | — | 2 | — | 1 | 8.4 | — | MIT | 7 months ago |
|
| codeception/module-asserts | 0.84 | Codeception Asserts module adds rich assertion helpers for your tests, letting you use a wide set of PHPUnit-style assertions directly in Codeception suites. Ideal for unit, functional, and acceptance tests to keep checks readable and failures clear. | 86 | 87 | 10 | 1M | 0 | 13.4 | 59.3 | MIT | 10 months ago | |
| phpspec/prophecy-phpunit | 0.84 | Integrates the Prophecy mocking library with PHPUnit for simpler, cleaner test doubles. Install via Composer and use the ProphecyTrait to call prophesize() inside your TestCase, set method predictions/returns, and reveal mocks for injection. | 195 | 195 | 39 | 1M | 1 | 11.7 | 56.7 | MIT | 8 months ago | |
| phpunit/phpunit-dom-assertions | 0.84 | Adds expressive DOM assertions to PHPUnit for testing HTML and XML output, letting you assert elements, attributes, text content, and structure using a fluent, readable API built on Symfony's DomCrawler and CssSelector components. | 29 | — | 13 | — | 1 | 6.3 | — | NOASSERTION | 8 months ago |
|
| php-mock/php-mock | 0.83 | Mock built-in PHP functions like time() or rand() in tests by leveraging PHP’s namespace fallback: define namespaced replacements for unqualified calls. Works in non-global namespaces; supports common test frameworks via integrations (e.g., PHPUnit). | 370 | 375 | 19 | 726K | 3 | 13.0 | 47.8 | WTFPL | 9 months ago |
How can I help you explore Laravel packages today?