Code Duplication    Length = 15-15 lines in 2 locations

tests/unit/Handler/NullAcknowledgementHandlerTest.php 2 locations

@@ 54-68 (lines=15) @@
51
        $this->handler = new NullAcknowledgementHandler();
52
    }
53
54
    public function testHandle()
55
    {
56
        $handler = $this->handler;
57
58
        $this->messageA->shouldReceive('isValid')->once()->withNoArgs()->andReturn(true);
59
        $this->messageB->shouldReceive('isValid')->once()->withNoArgs()->andReturn(true);
60
        $this->messageC->shouldReceive('isValid')->once()->withNoArgs()->andReturn(true);
61
62
        $msgs = [];
63
        $handler($this->messages, $this->adapter, function ($msg) use (&$msgs) {
64
            $msgs[] = $msg;
65
        });
66
67
        assertThat($msgs, is(identicalTo(iterator_to_array($this->messages))));
68
    }
69
70
    public function testHandleInvalidMessage()
71
    {
@@ 70-84 (lines=15) @@
67
        assertThat($msgs, is(identicalTo(iterator_to_array($this->messages))));
68
    }
69
70
    public function testHandleInvalidMessage()
71
    {
72
        $handler = $this->handler;
73
74
        $this->messageA->shouldReceive('isValid')->once()->withNoArgs()->andReturn(true);
75
        $this->messageB->shouldReceive('isValid')->once()->withNoArgs()->andReturn(false);
76
        $this->messageC->shouldReceive('isValid')->once()->withNoArgs()->andReturn(true);
77
78
        $msgs = [];
79
        $handler($this->messages, $this->adapter, function ($msg) use (&$msgs) {
80
            $msgs[] = $msg;
81
        });
82
83
        assertThat($msgs, is(identicalTo([$this->messageA, $this->messageC])));
84
    }
85
86
    public function testHandleWorkerWithThrownException()
87
    {