test: Rename parameters to show that they are expected values

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
pull/52012/head
Daniel Calviño Sánchez 2025-03-31 21:04:21 +07:00
parent 45f2683a73
commit a0e8d943f1
1 changed files with 14 additions and 14 deletions

@ -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 {