@@ -39,13 +39,7 @@ public static function getHost(): ?string
39
39
if (false !== $ url ) {
40
40
return $ url ;
41
41
}
42
- switch (getenv ('TEST_SUITE ' )) {
43
- case 'free ' :
44
- return 'http://localhost:9200 ' ;
45
- case 'platinum ' :
46
- return 'https://elastic:changeme@localhost:9200 ' ;
47
- }
48
- return null ;
42
+ return 'https://elastic:changeme@localhost:9200 ' ;
49
43
}
50
44
51
45
/**
@@ -62,9 +56,7 @@ public static function getClient(): Client
62
56
]
63
57
]
64
58
]);
65
- if (getenv ('TEST_SUITE ' ) === 'platinum ' ) {
66
- $ clientBuilder ->setSSLVerification (false );
67
- }
59
+ $ clientBuilder ->setSSLVerification (false );
68
60
return $ clientBuilder ->build ();
69
61
}
70
62
@@ -207,17 +199,20 @@ private static function wipeSnapshots(Client $client): void
207
199
$ repos = $ client ->snapshot ()->getRepository ([
208
200
'repository ' => '_all '
209
201
]);
210
- foreach ($ repos as $ name => $ value ) {
202
+ foreach ($ repos as $ repository => $ value ) {
211
203
if ($ value ['type ' ] === 'fs ' ) {
212
204
$ response = $ client ->snapshot ()->get ([
213
- 'repository ' => $ name ,
205
+ 'repository ' => $ repository ,
214
206
'snapshot ' => '_all ' ,
215
207
'ignore_unavailable ' => true
216
208
]);
209
+ if (isset ($ response ['responses ' ])) {
210
+ $ response = $ response ['responses ' ][0 ];
211
+ }
217
212
if (isset ($ response ['snapshots ' ])) {
218
213
foreach ($ response ['snapshots ' ] as $ snapshot ) {
219
214
$ client ->snapshot ()->delete ([
220
- 'repository ' => $ name ,
215
+ 'repository ' => $ repository ,
221
216
'snapshot ' => $ snapshot ['snapshot ' ],
222
217
'client ' => [
223
218
'ignore ' => 404
@@ -227,7 +222,7 @@ private static function wipeSnapshots(Client $client): void
227
222
}
228
223
}
229
224
$ client ->snapshot ()->deleteRepository ([
230
- 'repository ' => $ name ,
225
+ 'repository ' => $ repository ,
231
226
'client ' => [
232
227
'ignore ' => 404
233
228
]
0 commit comments