magento2-enhanced-smtp icon indicating copy to clipboard operation
magento2-enhanced-smtp copied to clipboard

Failing Unit Test

Open HenKun opened this issue 5 years ago • 0 comments

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]

HenKun avatar Feb 11 '20 09:02 HenKun