SecureSocketCest::sendSMTPMessageOverSecureSocket has been re-enabled since it is actually functional and passes with the right setup [1]
[1] For the test to pass the SMTP server needs to have a SSL certificate installed and the certificate also needs to be added into the client's trusted CA store ("client" in this case being the system PHP runs on). As such I've added a "stop gap" that skips the test if the connection fails.
This is might not be the best way, but it's tricky finding a clean solution because we are dealing with two types of failure here:
First is if the server does not have TLS support, this will generally fail with a "command does not exist" error referencing the STARTTLS command send by our code. (Tested using smtp-sink which we use on Travis)
Second is if the server does have a SSL certificate, but the client doesn't trust it, in my case this produced a valid response from the server, but with an unexpected status code resulting in our code throwing an exception for "unexpected response", with the actual response just being garbled characters (I assume this is because the server still encrypts the data). (Tested using smtp4dev)
Long story short, I was able to make it pass by integrating https://github.com/rnwood/smtp4dev into my docker setup and doing some "openssl magic", but I'm not sure how easy it is to replicate in the test environment.
SecureSocketCest::sendSMTPMessageOverSecureSocket
has been re-enabled since it is actually functional and passes with the right setup [1][1] For the test to pass the SMTP server needs to have a SSL certificate installed and the certificate also needs to be added into the client's trusted CA store ("client" in this case being the system PHP runs on). As such I've added a "stop gap" that skips the test if the connection fails.
This is might not be the best way, but it's tricky finding a clean solution because we are dealing with two types of failure here:
Long story short, I was able to make it pass by integrating https://github.com/rnwood/smtp4dev into my docker setup and doing some "openssl magic", but I'm not sure how easy it is to replicate in the test environment.