From 1b6d76aa1b475a72e601aed4b9c7a272f3e38f21 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 19 Jul 2024 19:31:10 +0200 Subject: [PATCH] test: fix share provider tests for sharding Signed-off-by: Robin Appelman --- tests/lib/Share20/DefaultShareProviderTest.php | 10 +++++----- tests/lib/Share20/ShareByMailProviderTest.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index 017deeef114..e498d497427 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -111,7 +111,7 @@ class DefaultShareProviderTest extends \Test\TestCase { protected function tearDown(): void { $this->dbConn->getQueryBuilder()->delete('share')->execute(); - $this->dbConn->getQueryBuilder()->delete('filecache')->execute(); + $this->dbConn->getQueryBuilder()->delete('filecache')->runAcrossAllShards()->execute(); $this->dbConn->getQueryBuilder()->delete('storages')->execute(); } @@ -924,10 +924,10 @@ class DefaultShareProviderTest extends \Test\TestCase { $qb = $this->dbConn->getQueryBuilder(); $qb->insert('filecache') ->values([ - 'storage' => $qb->expr()->literal($storage), - 'path' => $qb->expr()->literal($path), - 'path_hash' => $qb->expr()->literal(md5($path)), - 'name' => $qb->expr()->literal(basename($path)), + 'storage' => $qb->createNamedParameter($storage, IQueryBuilder::PARAM_INT), + 'path' => $qb->createNamedParameter($path), + 'path_hash' => $qb->createNamedParameter(md5($path)), + 'name' => $qb->createNamedParameter(basename($path)), ]); $this->assertEquals(1, $qb->execute()); return $qb->getLastInsertId(); diff --git a/tests/lib/Share20/ShareByMailProviderTest.php b/tests/lib/Share20/ShareByMailProviderTest.php index c3fe0dab790..7e3eee106e8 100644 --- a/tests/lib/Share20/ShareByMailProviderTest.php +++ b/tests/lib/Share20/ShareByMailProviderTest.php @@ -125,7 +125,7 @@ class ShareByMailProviderTest extends TestCase { protected function tearDown(): void { $this->dbConn->getQueryBuilder()->delete('share')->execute(); - $this->dbConn->getQueryBuilder()->delete('filecache')->execute(); + $this->dbConn->getQueryBuilder()->delete('filecache')->runAcrossAllShards()->execute(); $this->dbConn->getQueryBuilder()->delete('storages')->execute(); } -- 2.39.5