| Conditions | 2 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function testSend() |
||
| 17 | { |
||
| 18 | $kernel = new \AppKernel('test', true); |
||
| 19 | $kernel->boot(); |
||
| 20 | |||
| 21 | $container = $kernel->getContainer(); |
||
| 22 | |||
| 23 | $request = $this->prophesize(Request::class); |
||
| 24 | $request->getLocale()->willReturn('de'); |
||
| 25 | |||
| 26 | $requestStack = $this->prophesize(RequestStack::class); |
||
| 27 | $requestStack->getMasterRequest()->willReturn($request->reveal()); |
||
| 28 | $container->set('request_stack', $requestStack->reveal()); |
||
| 29 | |||
| 30 | try { |
||
| 31 | $container->get('system_mailer')->send('HautziSystemMail:test'); |
||
| 32 | $this->fail('fetching a mail that does nox exist should throw an exception.'); |
||
| 33 | } |
||
| 34 | catch (\InvalidArgumentException $e) { |
||
| 35 | $this->assertContains('@HautziSystemMailBundle/Resources/emails/test.xml.twig', $e->getMessage()); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | } |