|
@@ 42-53 (lines=12) @@
|
| 39 |
|
$this->assertInstanceOf('IrishDan\NotificationBundle\Message\MessageInterface', $message); |
| 40 |
|
} |
| 41 |
|
|
| 42 |
|
public function testDispatch() |
| 43 |
|
{ |
| 44 |
|
$this->eventDispatcher->expects($this->once())->method('dispatch'); |
| 45 |
|
|
| 46 |
|
$dispatcher = $this->getMockDispatcher(); |
| 47 |
|
$this->eventChannel->setDispatchers('default', $dispatcher); |
| 48 |
|
|
| 49 |
|
$message = $this->getTestMessage(); |
| 50 |
|
$message->setChannel('default'); |
| 51 |
|
|
| 52 |
|
$this->eventChannel->dispatch($message); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
public function testDispatchWithWrongChannelKey() |
| 56 |
|
{ |
|
@@ 55-66 (lines=12) @@
|
| 52 |
|
$this->eventChannel->dispatch($message); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
public function testDispatchWithWrongChannelKey() |
| 56 |
|
{ |
| 57 |
|
$dispatcher = $this->getMockDispatcher(); |
| 58 |
|
$this->eventChannel->setDispatchers('default', $dispatcher); |
| 59 |
|
|
| 60 |
|
$message = $this->getTestMessage(); |
| 61 |
|
$message->setChannel('not-default'); |
| 62 |
|
|
| 63 |
|
$this->setExpectedException(MessageDispatchException::class); |
| 64 |
|
|
| 65 |
|
$this->eventChannel->dispatch($message); |
| 66 |
|
} |
| 67 |
|
} |
| 68 |
|
|