|
@@ 95-106 (lines=12) @@
|
| 92 |
|
* @dataProvider provideValidEmails |
| 93 |
|
* @param $email |
| 94 |
|
*/ |
| 95 |
|
public function validEmailIsProperlySent($email) |
| 96 |
|
{ |
| 97 |
|
$buildEmail = $this->emailBuilder->build(Argument::cetera())->willReturn(new Email()); |
| 98 |
|
$send = $this->transport->send(Argument::type(Message::class))->willReturn(null); |
| 99 |
|
$trigger = $this->eventManager->triggerEvent(Argument::cetera())->willReturn(new ResponseCollection()); |
| 100 |
|
|
| 101 |
|
$this->mailService->send($email); |
| 102 |
|
|
| 103 |
|
$buildEmail->shouldHaveBeenCalledTimes(\is_object($email) ? 0 : 1); |
| 104 |
|
$send->shouldHaveBeenCalled(); |
| 105 |
|
$trigger->shouldHaveBeenCalledTimes(2); |
| 106 |
|
} |
| 107 |
|
|
| 108 |
|
public function provideValidEmails(): array |
| 109 |
|
{ |
|
@@ 165-176 (lines=12) @@
|
| 162 |
|
/** |
| 163 |
|
* @test |
| 164 |
|
*/ |
| 165 |
|
public function templateIsRendererIfProvided() |
| 166 |
|
{ |
| 167 |
|
$send = $this->transport->send(Argument::type(Message::class))->willReturn(null); |
| 168 |
|
$trigger = $this->eventManager->triggerEvent(Argument::cetera())->willReturn(new ResponseCollection()); |
| 169 |
|
$render = $this->renderer->render(Argument::cetera())->willReturn(''); |
| 170 |
|
|
| 171 |
|
$this->mailService->send((new Email())->setTemplate('some/template')); |
| 172 |
|
|
| 173 |
|
$send->shouldHaveBeenCalledTimes(1); |
| 174 |
|
$trigger->shouldHaveBeenCalled(); |
| 175 |
|
$render->shouldHaveBeenCalledTimes(1); |
| 176 |
|
} |
| 177 |
|
|
| 178 |
|
/** |
| 179 |
|
* @test |