]> source.dussan.org Git - nextcloud-server.git/commitdiff
compatibility to Nc 20
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Wed, 17 Feb 2021 14:57:37 +0000 (15:57 +0100)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Wed, 17 Feb 2021 16:09:33 +0000 (17:09 +0100)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/Repair/RepairDavShares.php
tests/lib/Repair/RepairDavSharesTest.php

index 64104c1e28a59296443de827723c3f30efece853..5c5ac4959b8427557f015b7922f5ea09986de22a 100644 (file)
@@ -25,7 +25,7 @@ declare(strict_types=1);
 
 namespace OC\Repair;
 
-use OCP\DB\Exception;
+use Doctrine\DBAL\DBALException;
 use OCP\IConfig;
 use OCP\IDBConnection;
 use OCP\IGroupManager;
@@ -112,7 +112,7 @@ class RepairDavShares implements IRepairStep {
                                        ->setParameter('shareId', $share['id'])
                                        ->execute();
                                $this->logger->info('Repaired principal for dav share {id} from {old} to {new}', $logParameters);
-                       } catch (Exception $e) {
+                       } catch (DBALException $e) {
                                $logParameters['message'] = $e->getMessage();
                                $logParameters['exception'] = $e;
                                $this->logger->info('Could not repair principal for dav share {id} from {old} to {new}: {message}', $logParameters);
index 199a9a101ea27b962592f67feaa5b992d29b0380..ad18409a88814ed31ba4e14bfa20db70a2db4699 100644 (file)
@@ -25,8 +25,8 @@ declare(strict_types=1);
 
 namespace Test\Repair;
 
+use Doctrine\DBAL\Driver\Statement;
 use OC\Repair\RepairDavShares;
-use OCP\DB\IResult;
 use OCP\DB\QueryBuilder\IExpressionBuilder;
 use OCP\DB\QueryBuilder\IQueryBuilder;
 use OCP\IConfig;
@@ -130,7 +130,7 @@ class RepairDavSharesTest extends TestCase {
                        ],
                ];
 
-               $shareResults = $this->createMock(IResult::class);
+               $shareResults = $this->createMock(Statement::class);
                $shareResults->expects($this->any())
                        ->method('fetch')
                        ->willReturnCallback(function () use (&$shareResultData) {