Skip to content

Commit

Permalink
add files
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Dec 10, 2019
1 parent f626bad commit 5b3cc97
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions tests/Integration/Broadcasting/BroadcastManagerTest.php
Original file line number Diff line number Diff line change
@@ -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.