Failing Unit Test
HenKun opened this issue · 0 comments
HenKun commented
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('test1@example.com', '') does not match expected value.
'test1@example.com' 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]