|
@@ 26-66 (lines=41) @@
|
| 23 |
|
$this->assertContainerBuilderNotHasService('liip_monitor.reporter.swift_mailer'); |
| 24 |
|
} |
| 25 |
|
|
| 26 |
|
public function testSwiftMailer() |
| 27 |
|
{ |
| 28 |
|
$this->setParameter('liip_monitor.mailer.enabled', true); |
| 29 |
|
$this->setDefinition('mailer', new Definition(\Swift_Mailer::class)); |
| 30 |
|
|
| 31 |
|
$this->compile(); |
| 32 |
|
|
| 33 |
|
$this->assertContainerBuilderNotHasService('liip_monitor.reporter.symfony_mailer'); |
| 34 |
|
$this->assertContainerBuilderHasService('liip_monitor.reporter.swift_mailer', SwiftMailerReporter::class); |
| 35 |
|
|
| 36 |
|
$this->assertContainerBuilderHasServiceDefinitionWithArgument( |
| 37 |
|
'liip_monitor.reporter.swift_mailer', |
| 38 |
|
0, |
| 39 |
|
new Reference('mailer') |
| 40 |
|
); |
| 41 |
|
$this->assertContainerBuilderHasServiceDefinitionWithArgument( |
| 42 |
|
'liip_monitor.reporter.swift_mailer', |
| 43 |
|
1, |
| 44 |
|
'%liip_monitor.mailer.recipient%' |
| 45 |
|
); |
| 46 |
|
$this->assertContainerBuilderHasServiceDefinitionWithArgument( |
| 47 |
|
'liip_monitor.reporter.swift_mailer', |
| 48 |
|
2, |
| 49 |
|
'%liip_monitor.mailer.sender%' |
| 50 |
|
); |
| 51 |
|
$this->assertContainerBuilderHasServiceDefinitionWithArgument( |
| 52 |
|
'liip_monitor.reporter.swift_mailer', |
| 53 |
|
3, |
| 54 |
|
'%liip_monitor.mailer.subject%' |
| 55 |
|
); |
| 56 |
|
$this->assertContainerBuilderHasServiceDefinitionWithArgument( |
| 57 |
|
'liip_monitor.reporter.swift_mailer', |
| 58 |
|
4, |
| 59 |
|
'%liip_monitor.mailer.send_on_warning%' |
| 60 |
|
); |
| 61 |
|
$this->assertContainerBuilderHasServiceDefinitionWithTag( |
| 62 |
|
'liip_monitor.reporter.swift_mailer', |
| 63 |
|
'liip_monitor.additional_reporter', |
| 64 |
|
['alias' => 'swift_mailer'] |
| 65 |
|
); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
public function testSwiftMailerWithAliasDefinition() |
| 69 |
|
{ |
|
@@ 81-121 (lines=41) @@
|
| 78 |
|
$this->assertContainerBuilderHasService('liip_monitor.reporter.swift_mailer', SwiftMailerReporter::class); |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
public function testSymfonyMailer() |
| 82 |
|
{ |
| 83 |
|
$this->setParameter('liip_monitor.mailer.enabled', true); |
| 84 |
|
$this->setDefinition('mailer', new Definition(MailerInterface::class)); |
| 85 |
|
|
| 86 |
|
$this->compile(); |
| 87 |
|
|
| 88 |
|
$this->assertContainerBuilderNotHasService('liip_monitor.reporter.swift_mailer'); |
| 89 |
|
$this->assertContainerBuilderHasService('liip_monitor.reporter.symfony_mailer', SymfonyMailerReporter::class); |
| 90 |
|
|
| 91 |
|
$this->assertContainerBuilderHasServiceDefinitionWithArgument( |
| 92 |
|
'liip_monitor.reporter.symfony_mailer', |
| 93 |
|
0, |
| 94 |
|
new Reference('mailer') |
| 95 |
|
); |
| 96 |
|
$this->assertContainerBuilderHasServiceDefinitionWithArgument( |
| 97 |
|
'liip_monitor.reporter.symfony_mailer', |
| 98 |
|
1, |
| 99 |
|
'%liip_monitor.mailer.recipient%' |
| 100 |
|
); |
| 101 |
|
$this->assertContainerBuilderHasServiceDefinitionWithArgument( |
| 102 |
|
'liip_monitor.reporter.symfony_mailer', |
| 103 |
|
2, |
| 104 |
|
'%liip_monitor.mailer.sender%' |
| 105 |
|
); |
| 106 |
|
$this->assertContainerBuilderHasServiceDefinitionWithArgument( |
| 107 |
|
'liip_monitor.reporter.symfony_mailer', |
| 108 |
|
3, |
| 109 |
|
'%liip_monitor.mailer.subject%' |
| 110 |
|
); |
| 111 |
|
$this->assertContainerBuilderHasServiceDefinitionWithArgument( |
| 112 |
|
'liip_monitor.reporter.symfony_mailer', |
| 113 |
|
4, |
| 114 |
|
'%liip_monitor.mailer.send_on_warning%' |
| 115 |
|
); |
| 116 |
|
$this->assertContainerBuilderHasServiceDefinitionWithTag( |
| 117 |
|
'liip_monitor.reporter.symfony_mailer', |
| 118 |
|
'liip_monitor.additional_reporter', |
| 119 |
|
['alias' => 'symfony_mailer'] |
| 120 |
|
); |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
public function testSymfonyMailerWithAliasDefinition() |
| 124 |
|
{ |