Skip to content

Failing Unit Test #8

@HenKun

Description

@HenKun

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions