@@ 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 testSymfonyMailer() |
|
69 | { |
|
@@ 68-108 (lines=41) @@ | ||
65 | ); |
|
66 | } |
|
67 | ||
68 | public function testSymfonyMailer() |
|
69 | { |
|
70 | $this->setParameter('liip_monitor.mailer.enabled', true); |
|
71 | $this->setDefinition('mailer', new Definition(MailerInterface::class)); |
|
72 | ||
73 | $this->compile(); |
|
74 | ||
75 | $this->assertContainerBuilderNotHasService('liip_monitor.reporter.swift_mailer'); |
|
76 | $this->assertContainerBuilderHasService('liip_monitor.reporter.symfony_mailer', SymfonyMailerReporter::class); |
|
77 | ||
78 | $this->assertContainerBuilderHasServiceDefinitionWithArgument( |
|
79 | 'liip_monitor.reporter.symfony_mailer', |
|
80 | 0, |
|
81 | new Reference('mailer') |
|
82 | ); |
|
83 | $this->assertContainerBuilderHasServiceDefinitionWithArgument( |
|
84 | 'liip_monitor.reporter.symfony_mailer', |
|
85 | 1, |
|
86 | '%liip_monitor.mailer.recipient%' |
|
87 | ); |
|
88 | $this->assertContainerBuilderHasServiceDefinitionWithArgument( |
|
89 | 'liip_monitor.reporter.symfony_mailer', |
|
90 | 2, |
|
91 | '%liip_monitor.mailer.sender%' |
|
92 | ); |
|
93 | $this->assertContainerBuilderHasServiceDefinitionWithArgument( |
|
94 | 'liip_monitor.reporter.symfony_mailer', |
|
95 | 3, |
|
96 | '%liip_monitor.mailer.subject%' |
|
97 | ); |
|
98 | $this->assertContainerBuilderHasServiceDefinitionWithArgument( |
|
99 | 'liip_monitor.reporter.symfony_mailer', |
|
100 | 4, |
|
101 | '%liip_monitor.mailer.send_on_warning%' |
|
102 | ); |
|
103 | $this->assertContainerBuilderHasServiceDefinitionWithTag( |
|
104 | 'liip_monitor.reporter.symfony_mailer', |
|
105 | 'liip_monitor.additional_reporter', |
|
106 | ['alias' => 'symfony_mailer'] |
|
107 | ); |
|
108 | } |
|
109 | ||
110 | public function testMailerWithoutPackage() |
|
111 | { |