| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 37 | public function logFailedSendAttempt(UnitTester $I) |
||
| 38 | { |
||
| 39 | $logger = new MockLogger(); |
||
| 40 | |||
| 41 | $service = new MailServiceLogger( |
||
| 42 | $logger, |
||
| 43 | new TotallyIncompetentMessageService() |
||
| 44 | ); |
||
| 45 | |||
| 46 | $message = new Message( |
||
| 47 | new Address("[email protected]", "Mister Foo"), |
||
| 48 | new Address("[email protected]"), |
||
| 49 | "Greetings, Friend!", |
||
| 50 | "How you been, bro?" |
||
| 51 | ); |
||
| 52 | |||
| 53 | try { |
||
| 54 | $service->send($message); |
||
| 55 | } catch (RuntimeException $e) { |
||
| 56 | // expected |
||
| 57 | } |
||
| 58 | |||
| 59 | $I->assertSame( |
||
| 60 | ['ERROR: message not sent [RuntimeException: OMG! everything is broken!] via Kodus\Mail\Test\Unit\TotallyIncompetentMessageService to: Mister Foo <[email protected]> from: <[email protected]> with subject: Greetings, Friend!'], |
||
| 61 | $logger->records |
||
| 62 | ); |
||
| 65 |