4 Commits
Author SHA1 Message Date
objecttothisandClaude Sonnet 5 af48fa4357 fix(tests): standardize DB bootstrap/OSPOS mocking, fix stale-prefix bug (#4771)
Adds DatabaseBootstrapTrait and OsposConfigFixtureTrait to replace
duplicated per-file setUp()/tearDown() bootstrap and OSPOS config mock
boilerplate across test classes, bringing them in line with the
ItemsControllerTest gold-standard shape.

Fixes the real root cause of tabular_helperTest's suite-order-dependent
failure: dropAllForeignKeyConstraints()/foreignKeyExists()/
dropColumnIfExists() temporarily blank the shared connection's DBPrefix
via overridePrefix() but never restored it if the query between the two
calls threw (e.g. migration_helperTest's mocked-failure tests) -
permanently corrupting prefixed table lookups for the rest of the
process. Wrapped each in try/finally. Also widens executeScript() to
accept an explicit connection so migration SQL can't silently run
against the wrong DB group.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-23 10:10:37 +04:00
objecttothisandClaude Sonnet 5 0015b7575c Revert "Merge remote-tracking branch 'OpensourcePOS/master' into fix-unit-test-failures" and test-standardization commit (#4770)
These landed on master by accident via a local branch that was
mistakenly created tracking OpensourcePOS/master directly, rather than
pushed as its own branch. Reverting to restore master to its prior
state; the reverted work will come back through a proper PR instead.

This reverts commit 00bf4cb8af.
This reverts commit 37cc1b15e7.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-22 16:43:32 +04:00
objecttothisandClaude Sonnet 5 37cc1b15e7 fix(tests): standardize DB bootstrap/OSPOS mocking, fix stale-prefix bug
Adds DatabaseBootstrapTrait and OsposConfigFixtureTrait to replace
duplicated per-file setUp()/tearDown() bootstrap and OSPOS config mock
boilerplate across test classes, bringing them in line with the
ItemsControllerTest gold-standard shape.

Fixes the real root cause of tabular_helperTest's suite-order-dependent
failure: dropAllForeignKeyConstraints()/foreignKeyExists()/
dropColumnIfExists() temporarily blank the shared connection's DBPrefix
via overridePrefix() but never restored it if the query between the two
calls threw (e.g. migration_helperTest's mocked-failure tests) -
permanently corrupting prefixed table lookups for the rest of the
process. Wrapped each in try/finally. Also widens executeScript() to
accept an explicit connection so migration SQL can't silently run
against the wrong DB group.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-22 16:26:48 +04:00
BudsieBuds 35fc07e201 refactor(tests): normalize test namespaces to PSR-4 and clean up composer dependencies (#4758)
- Rename tests/helpers/ to tests/Helpers/ and add Tests\Helpers namespace
- Move CI3SecretConverterTest into tests/Libraries/ to eliminate duplicate case-conflict directory
- Map Config\ in composer.json PSR-4 autoloading
- Remove obsolete PHP 7 polyfill (random_compat) and redundant laminas-escaper
- Clean up unused dev dependencies (fakerphp, vfsstream, predis) and update tooling
- Safeguard table prefix restoration in migration_helper and reset config mock in LocaleHelperTest
2026-10-21 19:01:03 +04:00