@@ -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
@@ -208,17 +200,20 @@ private static function wipeSnapshots(Client $client): void
208
200
$ repos = $ client ->snapshot ()->getRepository ([
209
201
'repository ' => '_all '
210
202
]);
211
- foreach ($ repos as $ name => $ value ) {
203
+ foreach ($ repos as $ repository => $ value ) {
212
204
if ($ value ['type ' ] === 'fs ' ) {
213
205
$ response = $ client ->snapshot ()->get ([
214
- 'repository ' => $ name ,
206
+ 'repository ' => $ repository ,
215
207
'snapshot ' => '_all ' ,
216
208
'ignore_unavailable ' => true
217
209
]);
210
+ if (isset ($ response ['responses ' ])) {
211
+ $ response = $ response ['responses ' ][0 ];
212
+ }
218
213
if (isset ($ response ['snapshots ' ])) {
219
214
foreach ($ response ['snapshots ' ] as $ snapshot ) {
220
215
$ client ->snapshot ()->delete ([
221
- 'repository ' => $ name ,
216
+ 'repository ' => $ repository ,
222
217
'snapshot ' => $ snapshot ['snapshot ' ],
223
218
'client ' => [
224
219
'ignore ' => 404
@@ -228,7 +223,7 @@ private static function wipeSnapshots(Client $client): void
228
223
}
229
224
}
230
225
$ client ->snapshot ()->deleteRepository ([
231
- 'repository ' => $ name ,
226
+ 'repository ' => $ repository ,
232
227
'client ' => [
233
228
'ignore ' => 404
234
229
]
0 commit comments