Code Duplication    Length = 16-16 lines in 3 locations

Tests/Transport/Rpc/RpcClientTest.php 1 location

@@ 114-129 (lines=16) @@
111
    /**
112
     * @return CmobiAMQPChannel
113
     */
114
    protected function getChannelMock()
115
    {
116
        $channelMock = $this->getMockBuilder(CmobiAMQPChannel::class)
117
            ->disableOriginalConstructor()
118
            ->getMock();
119
        $channelMock
120
            ->expects($this->any())
121
            ->method('basic_publish')
122
            ->willReturn(true);
123
        $channelMock
124
            ->method('basicConsume')
125
            ->willReturn(true);
126
127
        return $channelMock;
128
    }
129
130
    /**
131
     * @param string $msg
132
     * @param null   $correlationId

Tests/Transport/Worker/TaskTest.php 1 location

@@ 77-92 (lines=16) @@
74
    /**
75
     * @return CmobiAMQPChannel
76
     */
77
    protected function getChannelMock()
78
    {
79
        $channelMock = $this->getMockBuilder(CmobiAMQPChannel::class)
80
            ->disableOriginalConstructor()
81
            ->getMock();
82
        $channelMock
83
            ->expects($this->any())
84
            ->method('basic_publish')
85
            ->willReturn(true);
86
        $channelMock
87
            ->method('basicConsume')
88
            ->willReturn(true);
89
90
        return $channelMock;
91
    }
92
93
    /**
94
     * @param string $msg
95
     * @param null   $correlationId

Tests/Transport/Subscriber/PublisherTest.php 1 location

@@ 124-139 (lines=16) @@
121
    /**
122
     * @return CmobiAMQPChannel
123
     */
124
    protected function getChannelMock()
125
    {
126
        $channelMock = $this->getMockBuilder(CmobiAMQPChannel::class)
127
            ->disableOriginalConstructor()
128
            ->getMock();
129
        $channelMock
130
            ->expects($this->any())
131
            ->method('basic_publish')
132
            ->willReturn(true);
133
        $channelMock
134
            ->method('basicConsume')
135
            ->willReturn(true);
136
137
        return $channelMock;
138
    }
139
140
    /**
141
     * @param string $msg
142
     * @param null   $correlationId