Skip to content

Use custom Mailer class for running tests  #14718

@bologer

Description

@bologer

What steps will reproduce the problem?

I'm overriding Mailer class with my own and use it to create queue of emails.

When I run tests, it seems to be using another class (Codeception\Lib\Connector\Yii2\TestMailer).

What is the expected result?

Use custom Mailing class.

What do you get instead?

Exception with message for each test where mailing class with custom method myOwnMathod() is used:

[yii\base\UnknownMethodException] Calling unknown method: Codeception\Lib\Connector\Yii2\TestMailer::myOwnMathod()

Where myOwnMethod() is defined in my overriten mailer class, but as in tests it is using \yii\swiftmailer\Mailer, which certainly is missing that method.

Is there a way to set-up custom mailing class for tests?

Q A
Yii version 2.0.12
PHP version 5.5+
Operating system Ubuntu 14.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions