magento2-enhanced-smtp
magento2-enhanced-smtp copied to clipboard
Failing Unit Test
Failing unit test due to wrong expectation
Preconditions
Magento 2.3.2 Enhance Smtp 1.0.7
Steps to reproduce
Run unit Test SendEmailTest::testSendEmail
Expected result
Test passes
Actual result
Test fails:
Expectation failed for method name is equal to 'addTo' when invoked 1 time(s)
Parameter 0 for invocation Magento\Framework\Mail\Template\TransportBuilder::addTo('[email protected]', '') does not match expected value.
'[email protected]' does not match expected type "array".
Solution
Due to issue #6 the implementation of SendEmail::sendEmail()
was changed to pass $toEmail
instead of [$toEmail]
to the addTo()
method.
So the unit test should be modified to, to expect $this->toEmail
instead of [$this->toEmail]