nicolasguilloux/phpunit-dependency-injection-bundle
A PHPUnit dependency injection bundle that lets tests resolve services from a container instead of constructing dependencies manually. Keeps test classes lean and setup simple for container-based PHP apps. Low adoption, so expect limited docs and community support.
This release is a maintenance cut (dependency pruning, PHP 7.4/8.0/8.1 matrix coverage, stronger test suite) — no new public API. Start where you would for any Laravel package:
composer require <vendor>/<package> and confirm your app's PHP constraint overlaps ^7.4|^8.0|^8.1. If you're on 8.2+, run the suite once before trusting it in CI — the 8.1 upper bound is a tested range, not necessarily a hard block.vendor/<vendor>/<package>/src and check extra.laravel.providers in its composer.json for auto-discovery. If discovery is off, register manually in config/app.php.php artisan vendor:publish --provider="Vendor\Package\PackageServiceProvider" to see whether config, migrations, or views ship with it.php artisan tinker (app(\Vendor\Package\Client::class)) before wiring it into a controller. This surfaces missing config and credential errors in isolation.Because the release removed dependencies, the fastest smoke test is a fresh install into a scratch Laravel app — if the package was leaning on a transitive package it no longer declares, that's where it shows up.
config/ file when you need environment-specific defaults.App\Support\X) that delegates to the package. When the package bumps major versions or you swap it out, you change one file.swap hook if it provides one; otherwise bind an interface in the container during tests. With the expanded test suite in this release, you can also crib assertions from vendor/.../tests to model your own integration tests.composer update --prefer-lowest in one job to catch undeclared-dependency regressions — directly relevant after a release that removed dependencies.Class not found after upgrading, run composer why-not <vendor>/<package> <version> and check whether the missing class came from a package you used to get transitively. Add it explicitly to your composer.json if so.composer.lock for applications; do not for libraries. Upgrade in a branch, run the full suite, and read the diff of vendor/<vendor>/<package> if anything behaves oddly — maintenance releases with no changelog detail are exactly when a git diff pays for itself.${var} string interpolation) rather than hard failures. If you're on 8.2/8.3, add error_reporting(E_ALL & ~E_DEPRECATED) only in test bootstrap, never in production, and file an issue upstream.php artisan about, then php artisan tinker → app()->getLoadedProviders() to confirm registration, and config('package.key') to confirm config published to the right path. Most "package doesn't work" reports are unpublished config or a cached config file — php artisan config:clear first.register() and let boot() run the package's own boot logic; binding in boot() is too late for other providers' register()-time resolutions.How can I help you explore Laravel packages today?