Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing with ddeboer/imap #583

Open
nedvice-sv opened this issue Nov 9, 2024 · 1 comment
Open

Testing with ddeboer/imap #583

nedvice-sv opened this issue Nov 9, 2024 · 1 comment
Labels

Comments

@nedvice-sv
Copy link

I want to create a test where I mock the messages and what it should return since I'm running these tests in a pipeline and not with a real database.

I can't find an example of where to and how to test with the library. Every single class is final (Which is considered a bad practise as far as I know...)

The case I'm trying to create is:
Test the Laravel command. The command is fetching the messages from the server. Test if the messages are being returned. Test if we can create the messages in the database. Test any other action that is used from the messages.

To actually test something I need to first parse the Messages, put the information in my own 'model' and test with that.. (it should be a more safer option but still was I wondering if there was another solution...)

Hopfully someone can help/give me some feedback on how to approach this.

Kind regards,

@Slamdunk
Copy link
Collaborator

I wrote a test to demonstrate every bit of this library is mockable, have a look there:
https://github.com/ddeboer/imap/blob/1.21.0/tests/MockabilityTest.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants