# ACC-P2-16 — Phase 2 test report

## Test topology

`Phase2TestFixtureSeeder` creates two isolated companies, five canonical
accounting roles per company, matching accounts, an open period, and two
non-overlapping approval rules for the first company.  It is opt-in and is
never called by `DatabaseSeeder`.

## MySQL command

Run against an empty disposable MySQL database only:

```bash
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_DATABASE=erpflow_testing \
DB_USERNAME=erpflow DB_PASSWORD=secret \
vendor/bin/phpunit --configuration=phpunit.mysql.xml
```

The `Accounting MySQL acceptance` workflow executes this command on MySQL 8.4.
SQLite remains the fast default test database; it must not be used as evidence
for trigger, composite-foreign-key, or multi-connection assertions.

## Executed evidence (2026-11-05)

- `php artisan test Modules/Accounting/tests/Feature/Phase2TestFixtureSeederTest.php --testdox`
  — passed: 1 test, 9 assertions (SQLite).
- `vendor/bin/phpunit --configuration=phpunit.mysql.xml Modules/Accounting/tests/Feature/Phase2TestFixtureSeederTest.php --testdox`
  — passed: 1 test, 9 assertions (MySQL 8.4, isolated `erpflow_testing`).

The full MySQL group and the application regression suite are deliberately not
recorded as green here: passing one fixture test is not evidence for AC2.1–
AC2.14.

## Current evidence and outstanding acceptance gaps

The existing repository has tests for state transitions, validation, SoD,
history, rule resolution, reversal, opening balance, idempotency and database
guards.  However, the source currently has no posting service/API that owns
voucher allocation, idempotent posting, or a failure-injection seam. Therefore
the following ACC-P2-16 requirements cannot honestly be reported green yet:

- 50 concurrent post attempts over independent connections;
- gap-free voucher allocation under those attempts;
- post failure injection proving a complete rollback;
- post API error contracts (`JRN_NOT_APPROVED`, period warning path).

These are implementation/dependency gaps in the preceding P2 posting task,
not gaps that a test-only change can resolve. Once that contract exists, add
the MySQL-only `PostAtomicityTest`, `VoucherSequenceTest`, and
`ConcurrencyTest` cases to this runner and record the exact PHPUnit output
here. Do not mark AC2.1–AC2.14 or the first six golden tests green before that
run succeeds.
