File tree Expand file tree Collapse file tree 5 files changed +13
-10
lines changed Expand file tree Collapse file tree 5 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -831,8 +831,8 @@ public function testUpdateDocumentsCsvInBatches(): void
831
831
832
832
$ documentCsv = file_get_contents ('./tests/datasets/songs.csv ' , true );
833
833
834
- $ addPromise = $ index ->addDocumentsCsv ($ documentCsv );
835
- $ index ->waitForTask ($ addPromise [ ' taskUid ' ] );
834
+ $ task = $ index ->addDocumentsCsv ($ documentCsv );
835
+ $ index ->waitForTask ($ task -> getTaskUid () );
836
836
837
837
$ replacement = 'id,title ' .PHP_EOL ;
838
838
$ replacement .= '888221515,Young folks ' .PHP_EOL ;
@@ -895,8 +895,8 @@ public function testUpdateDocumentsNdjsonInBatches(): void
895
895
$ documentNdJson = fread ($ fileNdJson , filesize ('./tests/datasets/songs.ndjson ' ));
896
896
fclose ($ fileNdJson );
897
897
898
- $ addPromise = $ index ->addDocumentsNdjson ($ documentNdJson );
899
- $ index ->waitForTask ($ addPromise [ ' taskUid ' ] );
898
+ $ task = $ index ->addDocumentsNdjson ($ documentNdJson );
899
+ $ index ->waitForTask ($ task -> getTaskUid () );
900
900
901
901
$ replacement = json_encode (['id ' => 412559401 , 'title ' => 'WASPTHOVEN ' ]).PHP_EOL ;
902
902
$ replacement .= json_encode (['id ' => 70764404 , 'artist ' => 'Ailitp ' ]).PHP_EOL ;
Original file line number Diff line number Diff line change @@ -230,9 +230,11 @@ public function testWaitForTaskWithTimeout(): void
230
230
231
231
public function testExceptionWhenTaskTimeOut (): void
232
232
{
233
- $ res = $ this ->index ->addDocuments ([['id ' => 1 , 'title ' => 'Pride and Prejudice ' ]]);
233
+ $ task = $ this ->index ->addDocuments ([['id ' => 1 , 'title ' => 'Pride and Prejudice ' ]]);
234
+
234
235
$ this ->expectException (TimeOutException::class);
235
- $ this ->index ->waitForTask ($ res ['taskUid ' ], 0 , 20 );
236
+
237
+ $ this ->index ->waitForTask ($ task ->getTaskUid (), 0 , 20 );
236
238
}
237
239
238
240
public function testDeleteIndexes (): void
Original file line number Diff line number Diff line change @@ -131,8 +131,9 @@ public function testBasicSearchIfNoPrimaryKeyAndDocumentProvided(): void
131
131
public function testExceptionIfNoIndexWhenSearching (): void
132
132
{
133
133
$ index = $ this ->createEmptyIndex ($ this ->safeIndexName ('movie-1 ' ));
134
- $ res = $ index ->delete ();
135
- $ index ->waitForTask ($ res ['taskUid ' ]);
134
+
135
+ $ task = $ index ->delete ();
136
+ $ index ->waitForTask ($ task ->getTaskUid ());
136
137
137
138
$ this ->expectException (ApiException::class);
138
139
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ public function testGenerateTenantTokenWithFilter(): void
73
73
$ taskFromFilter = $ this ->client ->index ('tenantToken ' )->updateFilterableAttributes ([
74
74
'id ' ,
75
75
]);
76
- $ this ->client ->waitForTask ($ taskFromFilter[ ' taskUid ' ] );
76
+ $ this ->client ->waitForTask ($ taskFromFilter-> getTaskUid () );
77
77
78
78
$ token = $ this ->privateClient ->generateTenantToken ($ this ->key ->getUid (), (object ) ['tenantToken ' => (object ) ['filter ' => 'id > 10 ' ]]);
79
79
$ tokenClient = new Client ($ this ->host , $ token );
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ protected function tearDown(): void
91
91
$ tasks = [];
92
92
93
93
foreach ($ indexes as $ index ) {
94
- $ tasks [] = $ index ->delete ()[ ' taskUid ' ] ;
94
+ $ tasks [] = $ index ->delete ()-> getTaskUid () ;
95
95
}
96
96
97
97
$ this ->client ->waitForTasks ($ tasks );
You can’t perform that action at this time.
0 commit comments