Code Duplication    Length = 29-29 lines in 2 locations

Tests/Api/ClientTest.php 1 location

@@ 92-120 (lines=29) @@
89
    /**
90
     * @return Mockery\MockInterface
91
     */
92
    private function getClientProxyMock($reportStatus = 'Success')
93
    {
94
        $clientProxyMock = Mockery::mock(ClientProxy::class);
95
        $clientProxyMock
96
            ->shouldReceive('ConstructWithCredentials')
97
            ->andReturnSelf()
98
            ->once()
99
            ->shouldReceive('GetNamespace')
100
            ->between(1, 48)
101
            ->andReturn('Namespace')
102
            ->shouldReceive('GetService')
103
            ->between(2, 49)
104
            ->andReturnSelf()
105
            ->shouldReceive('SubmitGenerateReport')
106
            ->between(1, 48)
107
            ->andReturnSelf()
108
            ->shouldReceive('PollGenerateReport')
109
            ->between(1, 48)
110
            ->andReturnSelf();
111
112
        $status = new \stdClass();
113
        $status->Status = $reportStatus;
114
        $status->ReportDownloadUrl = 'http://example.com/download.zip';
115
116
        $clientProxyMock->ReportRequestId = 'reportID';
117
        $clientProxyMock->ReportRequestStatus = $status;
118
119
        return $clientProxyMock;
120
    }
121
122
    /**
123
     * @return Mockery\MockInterface

Tests/Api/Report/GeoLocationPerformanceReportTest.php 1 location

@@ 170-198 (lines=29) @@
167
    /**
168
     * @return Mockery\MockInterface
169
     */
170
    private function getClientProxyMock($reportStatus = 'Success')
171
    {
172
        $clientProxyMock = Mockery::mock(ClientProxy::class);
173
        $clientProxyMock
174
            ->shouldReceive('ConstructWithCredentials')
175
            ->andReturnSelf()
176
            ->once()
177
            ->shouldReceive('GetNamespace')
178
            ->between(1, 48)
179
            ->andReturn('Namespace')
180
            ->shouldReceive('GetService')
181
            ->between(2, 49)
182
            ->andReturnSelf()
183
            ->shouldReceive('SubmitGenerateReport')
184
            ->between(1, 48)
185
            ->andReturnSelf()
186
            ->shouldReceive('PollGenerateReport')
187
            ->between(1, 48)
188
            ->andReturnSelf();
189
190
        $status = new \stdClass();
191
        $status->Status = $reportStatus;
192
        $status->ReportDownloadUrl = 'http://example.com/download.zip';
193
194
        $clientProxyMock->ReportRequestId = 'reportID';
195
        $clientProxyMock->ReportRequestStatus = $status;
196
197
        return $clientProxyMock;
198
    }
199
200
    /**
201
     * @return Mockery\MockInterface