| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function testBroadcast() |
||
| 14 | { |
||
| 15 | $notifiable = new Broadcast(); |
||
| 16 | $configuration = [ |
||
| 17 | 'webhook' => 'http://slack.com/', |
||
| 18 | 'pusher_channel' => 'test_channel', |
||
| 19 | ]; |
||
| 20 | |||
| 21 | $channel = $this->getMockBuilder(ChannelInterface::class) |
||
| 22 | ->setMethods(['channelName', 'setDispatchToEvent', 'formatAndDispatch']) |
||
| 23 | ->disableOriginalConstructor() |
||
| 24 | ->getMock(); |
||
| 25 | $channel->expects($this->once())->method('channelName'); |
||
| 26 | $channel->expects($this->once())->method('setDispatchToEvent'); |
||
| 27 | $channel->expects($this->once())->method('formatAndDispatch'); |
||
| 28 | |||
| 29 | $notification = $this->getMockBuilder(NotificationInterface::class) |
||
| 30 | ->disableOriginalConstructor() |
||
| 31 | ->getMock(); |
||
| 32 | $notification->expects($this->once())->method('setNotifiable'); |
||
| 33 | |||
| 34 | $broadcaster = new Broadcaster($notifiable, $channel, $configuration); |
||
| 35 | $broadcaster->broadcast($notification); |
||
| 36 | } |
||
| 37 | } |