aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Lock/NonCachingDBLockingProviderTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Lock/NonCachingDBLockingProviderTest.php')
-rw-r--r--tests/lib/Lock/NonCachingDBLockingProviderTest.php31
1 files changed, 10 insertions, 21 deletions
diff --git a/tests/lib/Lock/NonCachingDBLockingProviderTest.php b/tests/lib/Lock/NonCachingDBLockingProviderTest.php
index 349a175b566..4f05f0ba892 100644
--- a/tests/lib/Lock/NonCachingDBLockingProviderTest.php
+++ b/tests/lib/Lock/NonCachingDBLockingProviderTest.php
@@ -1,27 +1,16 @@
<?php
+
/**
- * @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\Lock;
+use OC\Lock\DBLockingProvider;
+use OCP\IDBConnection;
use OCP\Lock\ILockingProvider;
+use OCP\Server;
/**
* @group DB
@@ -30,14 +19,14 @@ use OCP\Lock\ILockingProvider;
*/
class NonCachingDBLockingProviderTest extends DBLockingProviderTest {
/**
- * @return \OCP\Lock\ILockingProvider
+ * @return ILockingProvider
*/
protected function getInstance() {
- $this->connection = \OC::$server->getDatabaseConnection();
- return new \OC\Lock\DBLockingProvider($this->connection, $this->timeFactory, 3600, false);
+ $this->connection = Server::get(IDBConnection::class);
+ return new DBLockingProvider($this->connection, $this->timeFactory, 3600, false);
}
- public function testDoubleShared() {
+ public function testDoubleShared(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);