aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Collaboration/Collaborators/SearchResultTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Collaboration/Collaborators/SearchResultTest.php')
-rw-r--r--tests/lib/Collaboration/Collaborators/SearchResultTest.php38
1 files changed, 11 insertions, 27 deletions
diff --git a/tests/lib/Collaboration/Collaborators/SearchResultTest.php b/tests/lib/Collaboration/Collaborators/SearchResultTest.php
index 98e454f2834..687901c47a6 100644
--- a/tests/lib/Collaboration/Collaborators/SearchResultTest.php
+++ b/tests/lib/Collaboration/Collaborators/SearchResultTest.php
@@ -1,24 +1,8 @@
<?php
+
/**
- * @copyright Copyright (c) 2017 Joas Schilling
- *
- * @author 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: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\Collaboration\Collaborators;
@@ -31,9 +15,9 @@ use OCP\IContainer;
use Test\TestCase;
class SearchResultTest extends TestCase {
- /** @var IContainer|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IContainer|\PHPUnit\Framework\MockObject\MockObject */
protected $container;
- /** @var ISearch */
+ /** @var ISearch */
protected $search;
protected function setUp(): void {
@@ -44,7 +28,7 @@ class SearchResultTest extends TestCase {
$this->search = new Search($this->container);
}
- public function dataAddResultSet() {
+ public static function dataAddResultSet(): array {
return [
[[], ['exact' => []]],
[['users' => ['exact' => null, 'loose' => []]], ['exact' => ['users' => []], 'users' => []]],
@@ -54,11 +38,11 @@ class SearchResultTest extends TestCase {
}
/**
- * @dataProvider dataAddResultSet
* @param array $toAdd
* @param array $expected
*/
- public function testAddResultSet(array $toAdd, array $expected) {
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataAddResultSet')]
+ public function testAddResultSet(array $toAdd, array $expected): void {
$result = new SearchResult();
foreach ($toAdd as $type => $results) {
@@ -68,7 +52,7 @@ class SearchResultTest extends TestCase {
$this->assertEquals($expected, $result->asArray());
}
- public function dataHasResult() {
+ public static function dataHasResult(): array {
$result = ['value' => ['shareWith' => 'l1']];
return [
[[],'users', 'n1', false],
@@ -83,13 +67,13 @@ class SearchResultTest extends TestCase {
}
/**
- * @dataProvider dataHasResult
* @param array $toAdd
* @param string $type
* @param string $id
* @param bool $expected
*/
- public function testHasResult(array $toAdd, $type, $id, $expected) {
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataHasResult')]
+ public function testHasResult(array $toAdd, $type, $id, $expected): void {
$result = new SearchResult();
foreach ($toAdd as $addType => $results) {