Code Duplication    Length = 13-16 lines in 2 locations

Tests/OpenExchangeRatesServiceTest.php 2 locations

@@ 154-166 (lines=13) @@
151
    /**
152
     * @return \PHPUnit_Framework_MockObject_MockObject
153
     */
154
    private function mockRequest()
155
    {
156
        $fakeRequest = $this
157
            ->getMockBuilder('Mrzard\OpenExchangeRates\Service\HttpRequestInterface')
158
            ->setMethods(array('request'))
159
            ->getMock();
160
        $fakeRequest
161
            ->expects(static::any())
162
            ->method('request')
163
            ->will(static::returnSelf());
164
165
        return $fakeRequest;
166
    }
167
168
    /**
169
     * @return \PHPUnit_Framework_MockObject_MockObject|\Mrzard\OpenExchangeRates\Service\HttpResponseInterface
@@ 189-204 (lines=16) @@
186
     * @param $fakeResponse
187
     * @return \PHPUnit_Framework_MockObject_MockObject|\Mrzard\OpenExchangeRates\Service\HttpClientInterface
188
     */
189
    private function mockClient($fakeResponse)
190
    {
191
        $fakeClient = $this
192
            ->getMockBuilder('Mrzard\OpenExchangeRates\Service\HttpClientInterface')
193
            ->setMethods(array('request'))
194
            ->getMock();
195
196
        //our client will always return a our request
197
        $fakeClient
198
            ->expects(static::any())
199
            ->method('request')
200
            ->withAnyParameters()
201
            ->will(static::returnValue($fakeResponse));
202
203
        return $fakeClient;
204
    }
205
}