From d48132c93dbc613786da1f244bb2a294690e1b5d Mon Sep 17 00:00:00 2001 From: Funky Waddle Date: Thu, 11 Dec 2025 11:38:20 -0600 Subject: [PATCH] update README and CHANGELOG --- CHANGELOG.md | 9 +++++++++ README.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6db3658..559ad74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,3 +13,12 @@ All notable changes to this project will be documented in this file. - Unit of Work (opt‑in): identity map; deferred updates/deletes; relation‑aware delete cascades; optimistic locking; snapshot diffing (flagged); identity map controls; coalescing. - Event system: DAO and UoW events; listeners/subscribers. - CI: GitHub Actions matrix (PHP 8.1–8.3) with MySQL + Mongo services; guarded tests. + +#### 0.1.0 — 2025-12-11 + +- Dependencies: upgrade `mongodb/mongodb` to `^2.0` (tested at 2.1.x). Requires `ext-mongodb >= 2.1`. +- Tests: migrate to PHPUnit 10; update `phpunit.xml.dist` and test cases accordingly. +- MongoDB tests: marked as `@group mongo-integration` and skipped by default via `phpunit.xml.dist` group exclusion. Each test pings the server and skips when not available. +- SQL tests: stabilized MySQL `belongsToMany` eager and join-eager tests by aligning anonymous DAO constructors with runtime patterns and adding needed projections. +- PostgreSQL: fix identifier quoting by using double quotes in `PostgresGrammar` (no more backticks in generated DDL). `PostgresSmokeTest` passes when a Postgres instance is available. +- SQLite: portable DDL in schema tests; minor assertion cleanups for accessors/casters. diff --git a/README.md b/README.md index 777543f..919825a 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,38 @@ composer require getphred/pairity After install, you can use the CLI at `vendor/bin/pairity`. +## Testing + +This project uses PHPUnit 10. The default test suite excludes MongoDB integration tests by default for portability. + +- Install dev dependencies: + +``` +composer install +``` + +- Run the default suite (SQLite + unit tests; Mongo tests excluded by default): + +``` +vendor/bin/phpunit +``` + +- Run MongoDB integration tests (requires `ext-mongodb >= 2.1` and a reachable server): + - Provide connection via environment variables and include the group: + +``` +MONGO_HOST=127.0.0.1 MONGO_PORT=27017 \ +vendor/bin/phpunit --group mongo-integration +``` + +Notes: +- When Mongo is unavailable or the extension is missing, Mongo tests will self‑skip. +- PostgreSQL smoke test requires environment variables (skips if missing): + - `POSTGRES_HOST` (required to enable), optional `POSTGRES_PORT`, `POSTGRES_DB`, `POSTGRES_USER`, `POSTGRES_PASS`. + - PostgreSQL identifiers are generated with double quotes by the schema grammar. +- MySQL tests require: + - `MYSQL_HOST` (required to enable), optional `MYSQL_PORT`, `MYSQL_DB`, `MYSQL_USER`, `MYSQL_PASS`. + ## Quick start Minimal example with SQLite (file db.sqlite) and a simple `users` DAO/DTO.