Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| TestEvent | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| broadcastOn | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| broadcastAs | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Events; |
| 4 | |
| 5 | use Illuminate\Broadcasting\Channel; |
| 6 | use Illuminate\Broadcasting\InteractsWithSockets; |
| 7 | use Illuminate\Broadcasting\PresenceChannel; |
| 8 | use Illuminate\Broadcasting\PrivateChannel; |
| 9 | use Illuminate\Contracts\Broadcasting\ShouldBroadcast; |
| 10 | use Illuminate\Foundation\Events\Dispatchable; |
| 11 | use Illuminate\Queue\SerializesModels; |
| 12 | |
| 13 | class TestEvent implements ShouldBroadcast |
| 14 | { |
| 15 | public $message; |
| 16 | |
| 17 | public function __construct($message) |
| 18 | { |
| 19 | $this->message = $message; |
| 20 | } |
| 21 | |
| 22 | public function broadcastOn() |
| 23 | { |
| 24 | return new Channel('test-channel'); // public channel |
| 25 | } |
| 26 | |
| 27 | public function broadcastAs() |
| 28 | { |
| 29 | return 'test-event'; |
| 30 | } |
| 31 | } |