| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function testCreate() |
||
| 24 | { |
||
| 25 | $testBackend = $this->createMock('Sonata\NotificationBundle\Backend\MessageManagerBackend'); |
||
| 26 | |||
| 27 | $testBackend->expects($this->once()) |
||
| 28 | ->method('setDispatcher') |
||
| 29 | ; |
||
| 30 | |||
| 31 | $message = new Message(); |
||
| 32 | $message->setType('test'); |
||
| 33 | $message->setBody(array()); |
||
| 34 | |||
| 35 | $testBackend->expects($this->once()) |
||
| 36 | ->method('create') |
||
| 37 | ->will($this->returnValue($message)) |
||
| 38 | ; |
||
| 39 | |||
| 40 | $mMgr = $this->createMock('Sonata\NotificationBundle\Model\MessageManagerInterface'); |
||
| 41 | |||
| 42 | $mMgrBackend = new MessageManagerBackendDispatcher($mMgr, array(), '', array(array('types' => array('test'), 'backend' => $testBackend))); |
||
| 43 | |||
| 44 | $this->assertEquals($message, $mMgrBackend->create('test', array())); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |