CommonPHP Database includes a package-local PHPUnit configuration and unit tests.
From the package directory:
composer installFrom the monorepo, the root vendor directory can also satisfy the test suite because tests/bootstrap.php checks both package and workspace autoloaders.
From the monorepo root:
vendor/bin/phpunit -c package/database/phpunit.xml.distFrom package/database:
../../vendor/bin/phpunit -c phpunit.xml.distThe unit suite covers:
ConnectionDefinitionnormalization, config parsing, driver classes, driver instances, default flags, invalid names, invalid drivers, and invalid options;ConnectionRegistryconstruction, config loading, single and multiple connection configs, duplicate names, missing connections, default switching, removal, clearing, lazy driver creation, resolved driver caching, iteration, and constructor failure wrapping;DatabaseManagerregistration, static construction, config construction, default and named connection routing, lazy connection events, query delegation, prepared queries, profiling toggles, manual profiling, query events, logger behavior, transaction routing, runtime query failure wrapping, database exception pass-through, and driver operation failure wrapping;Queryaccessors, immutability, parameter binding, connection switching, manager execution, direct driver execution, result wrapping, parameter type detection, and missing executor failures;QueryResultiterable rows, count behavior, affected row helpers, insert IDs, first-row defaults, array/object/scalar/null scalar extraction, and empty results;Transactionbegin, commit, rollback, state changes, callback success, callback runtime failures, database exception rethrows, inactive operations, and begin/commit/rollback failure wrapping;AbstractDatabaseDriverdefault name, query preparation, count, scalar fetch behavior, protected helper behavior, and transaction delegation;FetchMode,ParameterType,ConnectedEvent,QueryExecutedEvent, and all database exception factory helpers.
Manual review should still cover concrete driver packages against real database engines. The core package test suite uses in-memory fixtures so it can verify contracts and behavior without external services.