Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 10, 2017
1 parent f83edc1 commit 9cb26b3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Events/EventsDispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ public function testBasicEventExecution()
$this->assertEquals('bar', $_SERVER['__event.test']);
}

public function testHaltingEventExecution()
{
unset($_SERVER['__event.test']);
$d = new Dispatcher;
$d->listen('foo', function ($foo) {
$this->assertTrue(true);
return 'here';
});
$d->listen('foo', function ($foo) {
throw new Exception('should not be called');
});
$d->until('foo', ['bar']);
}

public function testContainerResolutionOfEventHandlers()
{
$d = new Dispatcher($container = m::mock('Illuminate\Container\Container'));
Expand Down

0 comments on commit 9cb26b3

Please sign in to comment.