Code Duplication    Length = 15-15 lines in 4 locations

tests/Transport/AwsAuthV4Test.php 4 locations

@@ 39-53 (lines=15) @@
36
            $client->request('_status', 'GET');
37
        } catch (GuzzleException $e) {
38
            $guzzleException = $e->getGuzzleException();
39
            if ($guzzleException instanceof RequestException) {
40
                $request = $guzzleException->getRequest();
41
                $expected = 'AWS4-HMAC-SHA256 Credential=foo/'
42
                    .\date('Ymd').'/us-east-1/es/aws4_request, ';
43
                $this->assertStringStartsWith(
44
                    $expected,
45
                    $request->getHeaderLine('Authorization')
46
                );
47
                $this->assertSame(
48
                    'baz',
49
                    $request->getHeaderLine('X-Amz-Security-Token')
50
                );
51
            } else {
52
                throw $e;
53
            }
54
        }
55
    }
56
@@ 80-94 (lines=15) @@
77
            $client->request('_status', 'GET');
78
        } catch (GuzzleException $e) {
79
            $guzzleException = $e->getGuzzleException();
80
            if ($guzzleException instanceof RequestException) {
81
                $request = $guzzleException->getRequest();
82
                $expected = 'AWS4-HMAC-SHA256 Credential=foo/'
83
                    .\date('Ymd').'/us-east-1/es/aws4_request, ';
84
                $this->assertStringStartsWith(
85
                    $expected,
86
                    $request->getHeaderLine('Authorization')
87
                );
88
                $this->assertSame(
89
                    'baz',
90
                    $request->getHeaderLine('X-Amz-Security-Token')
91
                );
92
            } else {
93
                throw $e;
94
            }
95
        }
96
    }
97
@@ 118-132 (lines=15) @@
115
            $client->request('_status', 'GET');
116
        } catch (GuzzleException $e) {
117
            $guzzleException = $e->getGuzzleException();
118
            if ($guzzleException instanceof RequestException) {
119
                $request = $guzzleException->getRequest();
120
                $expected = 'AWS4-HMAC-SHA256 Credential=foo/'
121
                    .\date('Ymd').'/us-east-1/es/aws4_request, ';
122
                $this->assertStringStartsWith(
123
                    $expected,
124
                    $request->getHeaderLine('Authorization')
125
                );
126
                $this->assertSame(
127
                    'baz',
128
                    $request->getHeaderLine('X-Amz-Security-Token')
129
                );
130
            } else {
131
                throw $e;
132
            }
133
        }
134
    }
135
@@ 201-215 (lines=15) @@
198
            $client->request('_status', 'GET');
199
        } catch (GuzzleException $e) {
200
            $guzzleException = $e->getGuzzleException();
201
            if ($guzzleException instanceof RequestException) {
202
                $request = $guzzleException->getRequest();
203
                $expected = 'AWS4-HMAC-SHA256 Credential=foo/'
204
                    .\date('Ymd').'/us-east-1/es/aws4_request, ';
205
                $this->assertStringStartsWith(
206
                    $expected,
207
                    $request->getHeaderLine('Authorization')
208
                );
209
                $this->assertSame(
210
                    'baz',
211
                    $request->getHeaderLine('X-Amz-Security-Token')
212
                );
213
            } else {
214
                throw $e;
215
            }
216
        }
217
    }
218
}