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