aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/DB/ConnectionFactoryTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/DB/ConnectionFactoryTest.php')
-rw-r--r--tests/lib/DB/ConnectionFactoryTest.php30
1 files changed, 9 insertions, 21 deletions
diff --git a/tests/lib/DB/ConnectionFactoryTest.php b/tests/lib/DB/ConnectionFactoryTest.php
index de232bb1fdd..d09a83ca856 100644
--- a/tests/lib/DB/ConnectionFactoryTest.php
+++ b/tests/lib/DB/ConnectionFactoryTest.php
@@ -1,32 +1,19 @@
<?php
+
/**
- * @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com>
- *
- * @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\DB;
use OC\DB\ConnectionFactory;
use OC\SystemConfig;
+use OCP\ICacheFactory;
use Test\TestCase;
class ConnectionFactoryTest extends TestCase {
- public function splitHostFromPortAndSocketData() {
+ public static function splitHostFromPortAndSocketData(): array {
return [
['127.0.0.1', ['host' => '127.0.0.1']],
['db.example.org', ['host' => 'db.example.org']],
@@ -41,14 +28,15 @@ class ConnectionFactoryTest extends TestCase {
}
/**
- * @dataProvider splitHostFromPortAndSocketData
* @param string $host
* @param array $expected
*/
- public function testSplitHostFromPortAndSocket($host, array $expected) {
+ #[\PHPUnit\Framework\Attributes\DataProvider('splitHostFromPortAndSocketData')]
+ public function testSplitHostFromPortAndSocket($host, array $expected): void {
/** @var SystemConfig $config */
$config = $this->createMock(SystemConfig::class);
- $factory = new ConnectionFactory($config);
+ $cacheFactory = $this->createMock(ICacheFactory::class);
+ $factory = new ConnectionFactory($config, $cacheFactory);
$this->assertEquals($expected, self::invokePrivate($factory, 'splitHostFromPortAndSocket', [$host]));
}