Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function testCreate(): void |
||
28 | { |
||
29 | $testBackend = $this->createMock(MessageManagerBackend::class); |
||
30 | |||
31 | $testBackend->expects($this->once()) |
||
32 | ->method('setDispatcher') |
||
33 | ; |
||
34 | |||
35 | $message = new Message(); |
||
36 | $message->setType('test'); |
||
37 | $message->setBody([]); |
||
38 | |||
39 | $testBackend->expects($this->once()) |
||
40 | ->method('create') |
||
41 | ->willReturn($message) |
||
42 | ; |
||
43 | |||
44 | $mMgr = $this->createMock(MessageManagerInterface::class); |
||
45 | |||
46 | $mMgrBackend = new MessageManagerBackendDispatcher($mMgr, [], '', [['types' => ['test'], 'backend' => $testBackend]]); |
||
47 | |||
48 | $this->assertSame($message, $mMgrBackend->create('test', [])); |
||
49 | } |
||
50 | } |
||
51 |