zendframework / zend-mail

Mail component from Zend Framework
BSD 3-Clause "New" or "Revised" License
96 stars 111 forks source link

Imap::capability should always return an array #164

Closed klaussilveira closed 6 years ago

klaussilveira commented 7 years ago

If there was a communication failure getting the list of capabilities, the return type should be an array, not false.

Ocramius commented 7 years ago

Please do write a test case

On 11 Aug 2017 16:25, "Klaus Silveira" notifications@github.com wrote:

If there was a communication failure getting the list of capabilities, the return type should be an array, not false.

You can view, comment on, or merge this pull request online at:

https://github.com/zendframework/zend-mail/pull/164 Commit Summary

  • Imap::capability should always return an array

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zendframework/zend-mail/pull/164, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJakPI-1iKfjcx19lUCudkY0ArxCuMJks5sXGQ1gaJpZM4O0uWW .

klaussilveira commented 7 years ago

I tried. Not really possible without proper mocks and due the way the current suite is setup. It needs a real IMAP server and you can't control it's response from the suite. I only see two possible solutions: abstracting the raw connection logic so read/write methods in this class can be properly tested with mocks OR setting up something like mountebank and mock the socket.

Any suggestions?