vectorface/dunit
Vectorface's DUnit is a PHPUnit extension for database unit testing. It simplifies loading fixtures, isolating tests with transactions, and asserting on database state, helping PHP developers verify SQL-backed code against real databases in a familiar, lightweight PHPUnit workflow.
dunit --pull, curated images). It remains a strong reference design when deciding whether to write in-house database assertion helpers, adopt a maintained fixture library, or fork an existing one.--pull to refresh images, reworked and squashed default images, a php-nightly build) makes DUnit a data point for the "containerized, pinned test runtime vs. run-on-host" decision. This is now as much an environment-provisioning question as an assertion-library one.Consider it when:
php-nightly image and the reworked, smaller Debian-based images show the project treats the runtime as part of the product — useful if you are standardizing dev/CI parity.Look elsewhere when:
$COLUMNS and Ctrl+C handling) dates the line to the PHP 7 era. Verify maintenance status before assuming otherwise; treat it as unmaintained-until-proven-active, with no security-patch, PHP 8 compatibility, or response-time guarantees.RefreshDatabase, transactions, and assertDatabaseHas-style assertions; the marginal value is low and the integration/upgrade cost is real.--pull behavior also implies network access to a registry during test setup, which some pipelines forbid.Caveat introduced by this release: the shipped defaults now include a PHP 7 beta image. Do not adopt the default image matrix as-is; audit and pin images to versions you support, and confirm the Docker runner behaves under your signal/timeout handling (v2.1.0 fixed Ctrl+C handling, so pin ≥ 2.1.0 if you use the CLI runner).
For executives (one-liner): DUnit is a small, MIT-licensed database testing helper — table assertions and dataset fixtures — that also packages a Docker-based test runner; the new 2.1.0 release adds image-pull convenience, smaller base images, and reliability fixes, but the tooling is still rooted in the PHP 7 era, so we treat it as a design reference or fork candidate, not a dependency we adopt outright. Low cost to evaluate, meaningful reduction in test maintenance if the pattern fits.
For engineering leads: The package offers table assertions, dataset fixtures, and isolation helpers on PHPUnit/PDO, plus a CLI runner that can pull and use curated Docker images. v2.1.0 is a real but incremental release — signal handling, $COLUMNS/progress-output fixes, dunit --pull, a php-nightly image, and markedly slimmer default images. That argues for a time-boxed spike: fork the repo, verify it against our PHP versions and drivers, and either maintain the fork internally or reimplement its assertion API (a day or two) inside our own test utilities. If we do use the runner, pin ≥ 2.1.0 for the Ctrl+C fix and replace the PHP 7 beta image with a version we support.
For the wider team: Tests that compare real table contents to expected datasets catch query and migration regressions that mocks miss. DUnit demonstrates the ergonomics we want, and the 2.1.0 release shows it also cares about reproducible test runtimes; we will reproduce that ergonomics in a small internal helper and pin our own images rather than depend on the upstream package.
How can I help you explore Laravel packages today?