laravel-mongodb
laravel-mongodb copied to clipboard
refactor: consolidate repetitive model instantiations across tests
Description
This pull request refactors the test suite to eliminate redundant model instantiations. Several test cases repeatedly constructed identical User, Item, and Book model objects inline, leading to code duplication and reduced maintainability.
To address this:
- A set of factory-like helper methods has been introduced to create consistent test data.
- All repeated inline instantiations were replaced by these shared methods.
- This improves readability, enforces consistency, and simplifies future updates.
This is a non-functional change (refactor only) and does not alter the behaviour or scope of any existing tests.
Checklist
- [x] Add tests and ensure they pass