Code Duplication    Length = 13-16 lines in 2 locations

Tests/OpenExchangeRatesServiceTest.php 2 locations

@@ 164-176 (lines=13) @@
161
    /**
162
     * @return \PHPUnit_Framework_MockObject_MockObject
163
     */
164
    private function mockRequest()
165
    {
166
        $fakeRequest = $this
167
            ->getMockBuilder('Mrzard\OpenExchangeRates\Service\HttpRequestInterface')
168
            ->setMethods(array('request'))
169
            ->getMock();
170
        $fakeRequest
171
            ->expects(static::any())
172
            ->method('request')
173
            ->will(static::returnSelf());
174
175
        return $fakeRequest;
176
    }
177
178
    /**
179
     * @return \PHPUnit_Framework_MockObject_MockObject|\Mrzard\OpenExchangeRates\Service\HttpResponseInterface
@@ 204-219 (lines=16) @@
201
     * @param $fakeResponse
202
     * @return \PHPUnit_Framework_MockObject_MockObject|\Mrzard\OpenExchangeRates\Service\HttpClientInterface
203
     */
204
    private function mockClient($fakeResponse)
205
    {
206
        $fakeClient = $this
207
            ->getMockBuilder('Mrzard\OpenExchangeRates\Service\HttpClientInterface')
208
            ->setMethods(array('request'))
209
            ->getMock();
210
211
        //our client will always return a our request
212
        $fakeClient
213
            ->expects(static::any())
214
            ->method('request')
215
            ->withAnyParameters()
216
            ->will(static::returnValue($fakeResponse));
217
218
        return $fakeClient;
219
    }
220
}