- Remove OsposConfigFixtureTrait usage across test suite; settings are
now written through model(Appconfig::class)->batch_save() instead of
mocking the OSPOS config object directly
- OSPOSRulesTest keeps direct Config\OSPOS injection via
Factories::injectMock since it tests config-object behavior directly
- CashupControllerTest, ItemKitsControllerTest, GetItemDataRowTest,
LocaleHelperTest, export_helperTest, tabular_helperTest switch to
real DB-backed settings via Appconfig model
- GetItemDataRowTest, LocaleHelperTest, export_helperTest,
tabular_helperTest add DatabaseTestTrait/DatabaseBootstrapTrait and
migrate/seed config plus resetDatabaseOnce() in setUp()
- export_helperTest consolidates redundant parent::setUp() calls
scattered across individual test methods into a single call
This aligns tests with how settings are actually read at runtime
(DB-backed Appconfig) rather than relying on a config-mocking fixture
trait, reducing drift between test setup and production behavior.
Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
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>
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>
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>