| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 32 | public function testAdd() |
||
| 33 | { |
||
| 34 | $queue = 'queue'; |
||
| 35 | $handler = 'handler'; |
||
| 36 | $data = ['foo' => 'bar']; |
||
| 37 | |||
| 38 | $serialized_message = json_encode(compact('queue', 'handler', 'data')); |
||
| 39 | $message = new Message($queue, $handler, $data); |
||
| 40 | |||
| 41 | $this->driver |
||
| 42 | ->expects($this->once()) |
||
| 43 | ->method('enqueue') |
||
| 44 | ->with('queue', $serialized_message) |
||
| 45 | ->willReturn(true); |
||
| 46 | |||
| 47 | $this->serializer |
||
| 48 | ->expects($this->once()) |
||
| 49 | ->method('serialize') |
||
| 50 | ->with($message) |
||
| 51 | ->willReturn($serialized_message); |
||
| 52 | |||
| 53 | $this->assertTrue($this->queue->add($message)); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |