aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Share20/ShareByMailProviderTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Share20/ShareByMailProviderTest.php')
-rw-r--r--tests/lib/Share20/ShareByMailProviderTest.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/lib/Share20/ShareByMailProviderTest.php b/tests/lib/Share20/ShareByMailProviderTest.php
index c3fe0dab790..de4dc1a820c 100644
--- a/tests/lib/Share20/ShareByMailProviderTest.php
+++ b/tests/lib/Share20/ShareByMailProviderTest.php
@@ -24,6 +24,7 @@ use OCP\IUserManager;
use OCP\Mail\IMailer;
use OCP\Security\IHasher;
use OCP\Security\ISecureRandom;
+use OCP\Server;
use OCP\Share\IShare;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
@@ -85,7 +86,7 @@ class ShareByMailProviderTest extends TestCase {
private $settingsManager;
protected function setUp(): void {
- $this->dbConn = \OC::$server->getDatabaseConnection();
+ $this->dbConn = Server::get(IDBConnection::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->rootFolder = $this->createMock(IRootFolder::class);
$this->mailer = $this->createMock(IMailer::class);
@@ -125,7 +126,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();
}
@@ -179,7 +180,7 @@ class ShareByMailProviderTest extends TestCase {
$qb->setValue('token', $qb->expr()->literal($token));
}
if ($expiration) {
- $qb->setValue('expiration', $qb->createNamedParameter($expiration, IQueryBuilder::PARAM_DATE));
+ $qb->setValue('expiration', $qb->createNamedParameter($expiration, IQueryBuilder::PARAM_DATETIME_MUTABLE));
}
if ($parent) {
$qb->setValue('parent', $qb->expr()->literal($parent));
@@ -189,7 +190,7 @@ class ShareByMailProviderTest extends TestCase {
return $qb->getLastInsertId();
}
- public function testGetSharesByWithResharesAndNoNode() {
+ public function testGetSharesByWithResharesAndNoNode(): void {
$this->addShareToDB(
IShare::TYPE_EMAIL,
'external.one@domain.tld',
@@ -236,7 +237,7 @@ class ShareByMailProviderTest extends TestCase {
$this->assertEquals('external.one@domain.tld', $actual[0]->getSharedWith());
}
- public function testGetSharesByWithResharesAndNode() {
+ public function testGetSharesByWithResharesAndNode(): void {
$this->addShareToDB(
IShare::TYPE_EMAIL,
'external.one@domain.tld',