Skip to content
Permalink
Browse files

add files

  • Loading branch information
taylorotwell committed Dec 10, 2019
1 parent f626bad commit 5b3cc9752d873be96ac34d9062cc35aa9c95bd59
Showing with 67 additions and 0 deletions.
  1. +67 −0 tests/Integration/Broadcasting/BroadcastManagerTest.php
@@ -0,0 +1,67 @@
<?php

namespace Illuminate\Tests\Integration\Broadcasting;

use Illuminate\Broadcasting\BroadcastEvent;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\Facades\Bus;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Str;
use Orchestra\Testbench\TestCase;

/**
* @group integration
*/
class BroadcastManagerTest extends TestCase
{
public function testEventCanBeBroadcastNow()
{
Bus::fake();
Queue::fake();

Broadcast::queue(new TestEventNow);

Bus::assertDispatched(BroadcastEvent::class);
Queue::assertNotPushed(BroadcastEvent::class);
}

public function testEventsCanBeBroadcast()
{
Bus::fake();
Queue::fake();

Broadcast::queue(new TestEvent);

Bus::assertNotDispatched(BroadcastEvent::class);
Queue::assertPushed(BroadcastEvent::class);
}
}

class TestEvent implements ShouldBroadcast
{
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]
*/
public function broadcastOn()
{
//
}
}

class TestEventNow implements ShouldBroadcastNow
{
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]
*/
public function broadcastOn()
{
//
}
}

0 comments on commit 5b3cc97

Please sign in to comment.
You can’t perform that action at this time.