@@ -206,19 +206,19 @@ public function testBackgroundScanOnlyRecurseIncomplete() {
206206 public function testBackgroundScanNestedIncompleteFolders () {
207207 $ this ->storage ->mkdir ('folder ' );
208208 $ this ->scanner ->backgroundScan ();
209-
209+
210210 $ this ->storage ->mkdir ('folder/subfolder1 ' );
211211 $ this ->storage ->mkdir ('folder/subfolder2 ' );
212-
212+
213213 $ this ->storage ->mkdir ('folder/subfolder1/subfolder3 ' );
214214 $ this ->cache ->put ('folder ' , ['size ' => -1 ]);
215215 $ this ->cache ->put ('folder/subfolder1 ' , ['size ' => -1 ]);
216-
216+
217217 // do a scan to get the folders into the cache.
218218 $ this ->scanner ->backgroundScan ();
219219
220220 $ this ->assertTrue ($ this ->cache ->inCache ('folder/subfolder1/subfolder3 ' ));
221-
221+
222222 $ this ->storage ->file_put_contents ('folder/subfolder1/bar1.txt ' , 'foobar ' );
223223 $ this ->storage ->file_put_contents ('folder/subfolder1/subfolder3/bar3.txt ' , 'foobar ' );
224224 $ this ->storage ->file_put_contents ('folder/subfolder2/bar2.txt ' , 'foobar ' );
@@ -227,7 +227,7 @@ public function testBackgroundScanNestedIncompleteFolders() {
227227 $ this ->cache ->put ('folder/subfolder1 ' , ['size ' => -1 ]);
228228 $ this ->cache ->put ('folder/subfolder2 ' , ['size ' => -1 ]);
229229 $ this ->cache ->put ('folder/subfolder1/subfolder3 ' , ['size ' => -1 ]);
230-
230+
231231 $ this ->scanner ->backgroundScan ();
232232
233233 $ this ->assertTrue ($ this ->cache ->inCache ('folder/subfolder1/bar1.txt ' ));
@@ -343,9 +343,11 @@ public function testRepairParent() {
343343 $ this ->assertTrue ($ this ->cache ->inCache ('folder/bar.txt ' ));
344344 $ oldFolderId = $ this ->cache ->getId ('folder ' );
345345
346- // delete the folder without removing the childs
347- $ sql = 'DELETE FROM `*PREFIX*filecache` WHERE `fileid` = ? ' ;
348- \OC_DB ::executeAudited ($ sql , [$ oldFolderId ]);
346+ // delete the folder without removing the children
347+ $ query = \OC ::$ server ->getDatabaseConnection ()->getQueryBuilder ();
348+ $ query ->delete ('filecache ' )
349+ ->where ($ query ->expr ()->eq ('fileid ' , $ query ->createNamedParameter ($ oldFolderId )));
350+ $ query ->execute ();
349351
350352 $ cachedData = $ this ->cache ->get ('folder/bar.txt ' );
351353 $ this ->assertEquals ($ oldFolderId , $ cachedData ['parent ' ]);
@@ -367,9 +369,11 @@ public function testRepairParentShallow() {
367369 $ this ->assertTrue ($ this ->cache ->inCache ('folder/bar.txt ' ));
368370 $ oldFolderId = $ this ->cache ->getId ('folder ' );
369371
370- // delete the folder without removing the childs
371- $ sql = 'DELETE FROM `*PREFIX*filecache` WHERE `fileid` = ? ' ;
372- \OC_DB ::executeAudited ($ sql , [$ oldFolderId ]);
372+ // delete the folder without removing the children
373+ $ query = \OC ::$ server ->getDatabaseConnection ()->getQueryBuilder ();
374+ $ query ->delete ('filecache ' )
375+ ->where ($ query ->expr ()->eq ('fileid ' , $ query ->createNamedParameter ($ oldFolderId )));
376+ $ query ->execute ();
373377
374378 $ cachedData = $ this ->cache ->get ('folder/bar.txt ' );
375379 $ this ->assertEquals ($ oldFolderId , $ cachedData ['parent ' ]);
0 commit comments