Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaj committed Oct 27, 2016
1 parent 3cbccdb commit eadab52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/EmitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

use PHPUnit_Framework_TestCase;
use Tomaj\Hermes\Test\Driver\DummyDriver;
use Tomaj\Hermes\Dispatcher;
use Tomaj\Hermes\Emitter;
use Tomaj\Hermes\Message;

class EmitTest extends PHPUnit_Framework_TestCase
{
public function testEmitWithDummyDriver()
{
$driver = new DummyDriver();
$dispatcher = new Dispatcher($driver);
$emitter = new Emitter($driver);

$this->assertNull($driver->getMessage());

$dispatcher->emit(new Message('event-type', ['content']));
$emitter->emit(new Message('event-type', ['content']));

$message = $driver->getMessage();
$this->assertEquals('event-type', $message->getType());
Expand Down
5 changes: 3 additions & 2 deletions tests/Logger/LoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Tomaj\Hermes\Test\Driver\DummyDriver;
use Tomaj\Hermes\Test\Handler\TestHandler;
use Tomaj\Hermes\Message;
use Tomaj\Hermes\Emitter;
use Tomaj\Hermes\Dispatcher;

class LoggerTest extends PHPUnit_Framework_TestCase
Expand All @@ -14,9 +15,9 @@ public function testLoggerWithEmit()
{
$driver = new DummyDriver();
$testLogger = new TestLogger();
$dispatcher = new Dispatcher($driver, $testLogger);
$emitter = new Emitter($driver, $testLogger);
$message = new Message('test', ['asdsd' => 'asdsd']);
$dispatcher->emit($message);
$emitter->emit($message);

$logData = $testLogger->getLogs();
$this->assertCount(1, $logData);
Expand Down

0 comments on commit eadab52

Please sign in to comment.