| @@ 44-53 (lines=10) @@ | ||
| 41 | $this->assertInstanceOf(Driver::class, $manager->driverInstance()); |
|
| 42 | } |
|
| 43 | ||
| 44 | public function test_can_call_directly() |
|
| 45 | { |
|
| 46 | $response = (new MockSmsManager())->via('bar') |
|
| 47 | ->send('foo', function ($message) { |
|
| 48 | $message->to(['baz']); |
|
| 49 | }); |
|
| 50 | $this->assertInstanceOf(BarDriver::class, $response); |
|
| 51 | $this->assertEquals('foo', $response->getBody()); |
|
| 52 | $this->assertContains('baz', $response->getRecipients()); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function test_can_call_from_facade() |
|
| 56 | { |
|
| @@ 55-64 (lines=10) @@ | ||
| 52 | $this->assertContains('baz', $response->getRecipients()); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function test_can_call_from_facade() |
|
| 56 | { |
|
| 57 | $response = Sms::via('bar')->send('foo', function ($m) { |
|
| 58 | $m->to('baz'); |
|
| 59 | }); |
|
| 60 | ||
| 61 | $this->assertInstanceOf(BarDriver::class, $response); |
|
| 62 | $this->assertEquals('foo', $response->getBody()); |
|
| 63 | $this->assertContains('baz', $response->getRecipients()); |
|
| 64 | } |
|
| 65 | } |
|
| 66 | ||