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.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/lib/Collaboration/Collaborators/SearchResultTest.php b/tests/lib/Collaboration/Collaborators/SearchResultTest.php
index da879a7b7a4..687901c47a6 100644
--- a/tests/lib/Collaboration/Collaborators/SearchResultTest.php
+++ b/tests/lib/Collaboration/Collaborators/SearchResultTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -14,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 {
@@ -27,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' => []]],
@@ -37,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) {
@@ -51,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],
@@ -66,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) {