You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update mongodb/laravel-mongodb package to version 5.0 in composer.json (#40)
* Refactor StoreTest to use attributes for test annotations, update PHPUnit configuration and improve code type hints. Adjust .gitignore for PHPUnit cache directory and add ext-mongodb requirement in composer.json.
* Stop using deprecated RP_PRIMARY and replace it with PRIMARY in MongoDB read preferences.
* Update mongodb/laravel-mongodb package to version 5.0
* Add test script to composer.json for PHPUnit execution
* Update MongoDB package to ensure compatibility with v5
Refactor `first` method in Builder to handle object and array scenarios effectively. Adjust queries in Store and command files to use `getDatabase()` instead of `getMongoDB()`. Update property accessors for cache data to support object dereferencing.
* Remove deprecated MongoDB builder and helper classes, and refactor tests to use direct database connections. Update GitHub Actions to ensure MongoDB service is available during testing.
* Update MongoDB package and enhance test suite
- Add PHP attribute to require the MongoDB extension in tests.
- Refactor the `TestCase` class for improved environment setup.
- Introduce new test classes: `AdvancedCacheFeaturesTest`, `TaggedCacheTest`, and `LaravelIntegrationTest` to cover various aspects of the MongoDB cache driver.
- Implement tests for incrementing, decrementing, storing arrays/objects, and tagged cache functionality.
- Document test structure in README for clarity on test organization and coverage.
Copy file name to clipboardExpand all lines: README.md
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,59 @@ Advantages
66
66
67
67
php artisan mongodb:cache:dropindex
68
68
69
+
Testing
70
+
-------
71
+
72
+
This package includes tests that interact with a real MongoDB database to verify the functionality of the cache driver. The tests require a MongoDB instance to run successfully.
73
+
74
+
To run the tests:
75
+
76
+
1. Make sure you have MongoDB installed and running on your local machine
77
+
2. The test configuration is set in `phpunit.xml`:
-`LaravelIntegrationTest.php`: Tests integration with Laravel's Cache facade
109
+
110
+
Some functionality (like increment/decrement, forever storage) is intentionally tested in multiple contexts:
111
+
1. At the low-level Store implementation
112
+
2. Through Laravel's Cache facade
113
+
3. With tagged cache operations
114
+
115
+
This multi-layered approach ensures that all feature functionality works correctly at all levels of integration.
116
+
117
+
GitHub Actions
118
+
-------------
119
+
120
+
The package includes GitHub Actions workflows that automatically run tests against a MongoDB service. The MongoDB service is started as part of the CI workflow, ensuring tests are executed in an environment with a real MongoDB database.
0 commit comments