| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function testSendContactMail() |
||
| 16 | { |
||
| 17 | $mailer = $this->createMock(\Swift_Mailer::class); |
||
| 18 | $twigEngine = $this->createMock(TwigEngine::class); |
||
| 19 | $container = $this->createMock(ContainerInterface::class); |
||
| 20 | $request = $this->createMock(Request::class); |
||
| 21 | $requestStack = $this->createMock(RequestStack::class); |
||
| 22 | |||
| 23 | $mailer->expects($this->once())->method('send'); |
||
| 24 | $request->expects($this->once())->method('getScheme')->will($this->returnValue('http')); |
||
| 25 | $request->expects($this->once())->method('getHttpHost')->will($this->returnValue('example.com')); |
||
| 26 | $requestStack->expects($this->once())->method('getCurrentRequest')->will($this->returnValue($request)); |
||
| 27 | $container->expects($this->once())->method('get')->will($this->returnValue($requestStack)); |
||
| 28 | |||
| 29 | $formMailer = new FormMailer($mailer, $twigEngine, $container); |
||
| 30 | |||
| 31 | $formSubmission = $this->createMock(FormSubmission::class); |
||
| 32 | |||
| 33 | $formMailer->sendContactMail($formSubmission, '[email protected]', '[email protected]', 'subject'); |
||
| 34 | } |
||
| 35 | } |
||
| 36 |