Code Duplication    Length = 29-29 lines in 2 locations

Tests/Api/ClientTest.php 1 location

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

Tests/Api/Report/GeoLocationPerformanceReportTest.php 1 location

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