From a0e8d943f1f63bc47998efbd04d398645a691167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 31 Mar 2025 21:04:21 +0200 Subject: [PATCH] test: Rename parameters to show that they are expected values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- .../Collaborators/MailPluginTest.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/lib/Collaboration/Collaborators/MailPluginTest.php b/tests/lib/Collaboration/Collaborators/MailPluginTest.php index e74c901a716..48167301790 100644 --- a/tests/lib/Collaboration/Collaborators/MailPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/MailPluginTest.php @@ -89,13 +89,13 @@ class MailPluginTest extends TestCase { * @param string $searchTerm * @param array $contacts * @param bool $shareeEnumeration - * @param array $expected - * @param bool $exactIdMatch - * @param bool $reachedEnd + * @param array $expectedResult + * @param bool $expectedExactIdMatch + * @param bool $expectedMoreResults * @param bool $validEmail */ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetEmail')] - public function testSearch($searchTerm, $contacts, $shareeEnumeration, $expected, $exactIdMatch, $reachedEnd, $validEmail): void { + public function testSearch($searchTerm, $contacts, $shareeEnumeration, $expectedResult, $expectedExactIdMatch, $expectedMoreResults, $validEmail): void { $this->config->expects($this->any()) ->method('getAppValue') ->willReturnCallback( @@ -127,9 +127,9 @@ class MailPluginTest extends TestCase { $moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult); $result = $this->searchResult->asArray(); - $this->assertSame($exactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails'))); - $this->assertEquals($expected, $result); - $this->assertSame($reachedEnd, $moreResults); + $this->assertSame($expectedExactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails'))); + $this->assertEquals($expectedResult, $result); + $this->assertSame($expectedMoreResults, $moreResults); } public static function dataGetEmail(): array { @@ -569,14 +569,14 @@ class MailPluginTest extends TestCase { * * @param string $searchTerm * @param array $contacts - * @param array $expected - * @param bool $exactIdMatch - * @param bool $reachedEnd + * @param array $expectedResult + * @param bool $expectedExactIdMatch + * @param bool $expectedMoreResults * @param array $userToGroupMapping * @param bool $validEmail */ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetEmailGroupsOnly')] - public function testSearchGroupsOnly($searchTerm, $contacts, $expected, $exactIdMatch, $reachedEnd, $userToGroupMapping, $validEmail): void { + public function testSearchGroupsOnly($searchTerm, $contacts, $expectedResult, $expectedExactIdMatch, $expectedMoreResults, $userToGroupMapping, $validEmail): void { $this->config->expects($this->any()) ->method('getAppValue') ->willReturnCallback( @@ -627,9 +627,9 @@ class MailPluginTest extends TestCase { $moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult); $result = $this->searchResult->asArray(); - $this->assertSame($exactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails'))); - $this->assertEquals($expected, $result); - $this->assertSame($reachedEnd, $moreResults); + $this->assertSame($expectedExactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails'))); + $this->assertEquals($expectedResult, $result); + $this->assertSame($expectedMoreResults, $moreResults); } public static function dataGetEmailGroupsOnly(): array {