Files
shopit-back/tests
ncoronel 22ef5619f3 Refactor Catalog API: Remove Create Catalog Item Endpoint and Update Related Logic
- Removed the "Create Catalog" endpoint from the Postman collection.
- Updated the CatalogController to handle tenant-specific catalog items based on active events.
- Refactored CatalogItem model to automatically set event_id based on tenant's active_event_id during creation.
- Deleted StoreCatalogItemRequest and CatalogItemResource as they are no longer needed.
- Updated various services and controllers to utilize the new tenant-based catalog item retrieval logic.
- Added tests to ensure that catalog reads are limited to items associated with the active event.
2026-09-18 13:51:13 -03:00
..

Database isolation

Run the suite with composer test or vendor/bin/phpunit. Both use tests/bootstrap.php, which forces SQLite :memory: in all environment sources. Tests never need a MySQL test database or the local database credentials.

Tests\TestCase rejects cached configuration and validates the default connection before application providers boot. Its connection factory also rejects persistent databases, URLs, and alternate endpoints for named or dynamically built connections. Tests that need Laravel must extend this base class. Do not bypass these guards to make a failing test pass; adapt database-specific tests to SQLite or use a separately designed disposable database workflow.

php tests/verify-database-safety.php checks the guard and application wiring without running test setup, queries, migrations, or opening PDO connections.

The suite does not validate MySQL-specific behavior when using SQLite.