Adds easy way to mock IMAP/LDAP operations. This makes writing tests easier and the tests faster.
Details
- Reviewers
mollekopf - Group Reviewers
Restricted Project - Commits
- rK643b6d12b915: IMAP and LDAP Facades (mocking)
./phpunit
Diff Detail
- Repository
- rK kolab
- Branch
- dev/imap-facade
- Lint
Lint Skipped - Unit
No Test Coverage - Build Status
Buildable 53139 Build 18867: arc lint + arc unit
Event Timeline
I think this is a good idea. There's always a tradeoff where there is some value in testing against the actual backend vs having a mock + a separate imap backend test. But I think especially we the currently relatively simple interface having a mock makes a lot of sense to make our tests faster and more robust.
I'm going to keep tests against a real backend in tests/Feature/Backends/, where all IMAP methods should have it's test. Also DataMigrator tests and Infrastructure tests will stay this way.
But anywhere else we can use mocking.
This is now completed for LDAP and IMAP facades and ready for review. There were some more tricks needed, but I like the result. These changes already revealed two small bugs that I fixed.
| src/app/Console/Commands/Status/Health.php | ||
|---|---|---|
| 183 ↗ | (On Diff #14901) | This shouldn't change? |
| src/app/Console/Commands/Status/Health.php | ||
|---|---|---|
| 183 ↗ | (On Diff #14901) | This was one of the bugs I found. IMAP was being checked two times. See line 192. |
| src/app/Console/Commands/Status/Health.php | ||
|---|---|---|
| 183 ↗ | (On Diff #14901) | Makes sense. |