@@ 139-152 (lines=14) @@ | ||
136 | $this->assertEquals($options['file_options']['callback'], $transport->getOptions()->getCallback()); |
|
137 | } |
|
138 | ||
139 | public function testAdapterAsService() |
|
140 | { |
|
141 | $this->initServiceLocator([ |
|
142 | 'mail_adapter' => 'my_transport_service' |
|
143 | ]); |
|
144 | $transport = new Sendmail(); |
|
145 | $this->serviceLocator->set('my_transport_service', $transport); |
|
146 | $mailService = $this->mailServiceFactory->createServiceWithName( |
|
147 | $this->serviceLocator, |
|
148 | 'acmailer.mailservice.default', |
|
149 | '' |
|
150 | ); |
|
151 | $this->assertSame($transport, $mailService->getTransport()); |
|
152 | } |
|
153 | ||
154 | /** |
|
155 | * @expectedException \AcMailer\Exception\InvalidArgumentException |
|
@@ 185-197 (lines=13) @@ | ||
182 | ); |
|
183 | } |
|
184 | ||
185 | public function testAdapterAsInstance() |
|
186 | { |
|
187 | $expected = new Sendmail(); |
|
188 | $this->initServiceLocator([ |
|
189 | 'mail_adapter' => $expected |
|
190 | ]); |
|
191 | $mailService = $this->mailServiceFactory->createServiceWithName( |
|
192 | $this->serviceLocator, |
|
193 | 'acmailer.mailservice.default', |
|
194 | '' |
|
195 | ); |
|
196 | $this->assertSame($expected, $mailService->getTransport()); |
|
197 | } |
|
198 | ||
199 | public function testViewRendererService() |
|
200 | { |