entelisteam / lbaf-mysql
A simple and quick mysqli wrapper for connecting to MySQL from PHP.
1.0
2026-05-12 10:01 UTC
Requires
- php: ~8.2
- ext-mysqli: *
- entelisteam/lbaf-exception: ^1.0
Requires (Dev)
- phpunit/phpunit: ^12.0
- rector/rector: ^2.3.0
README
A simple and quick mysqli wrapper for MySQL/MariaDB.
Requirements
- PHP ~8.2 with
ext-mysqli - Docker (for integration tests only)
Install
composer install
Running tests
Unit tests need nothing extra:
composer test:unit
Integration tests run against a real MariaDB in Docker. Start the container once per session, then run the suite:
composer db:up
composer test:integration
composer db:down # when done
db:up is idempotent — safe to call when the container is already running. The container uses tmpfs, so data is ephemeral.
To run everything:
composer test
Test database connection
Defaults (overridable via env in phpunit.xml.dist or shell):
| Variable | Default |
|---|---|
LBAF_TEST_DB_HOST |
127.0.0.1 |
LBAF_TEST_DB_PORT |
33306 |
LBAF_TEST_DB_USER |
root |
LBAF_TEST_DB_PASSWORD |
(empty) |
LBAF_TEST_DB_NAME |
lbaf_test |
The bootstrap fails loudly if the database is unreachable — no silent skips.