This PR adds unit tests for the mailer part in the MainCommand class. The MainCommand class is responsible for sending emails using the MailerInterface. The tests ensure that the email is being sent with the correct parameters and that the email sending function is being called when expected.
Summary of Changes
Created a new test file MainCommandTest.php in the tests/Command directory.
Added a new class MainCommandTest that extends PHPUnit\Framework\TestCase.
Mocked the dependencies of MainCommand such as LoggerInterface, MailerInterface, EntityManagerInterface, and OkkazeoCrawler.
Injected the mocked dependencies into a new instance of MainCommand.
Added a test method for the execute method of MainCommand to assert that the send method of the MailerInterface is called with the correct parameters.
Added additional test methods for any other critical functions in MainCommand that interact with the mailer functionality.
Fixes #4.
To checkout this PR branch, run the following command in your terminal:
Description
This PR adds unit tests for the mailer part in the
MainCommand
class. TheMainCommand
class is responsible for sending emails using theMailerInterface
. The tests ensure that the email is being sent with the correct parameters and that the email sending function is being called when expected.Summary of Changes
MainCommandTest.php
in thetests/Command
directory.MainCommandTest
that extendsPHPUnit\Framework\TestCase
.MainCommand
such asLoggerInterface
,MailerInterface
,EntityManagerInterface
, andOkkazeoCrawler
.MainCommand
.execute
method ofMainCommand
to assert that thesend
method of theMailerInterface
is called with the correct parameters.MainCommand
that interact with the mailer functionality.Fixes #4.
To checkout this PR branch, run the following command in your terminal: