|
|
|
@ -89,13 +89,13 @@ class MailPluginTest extends TestCase {
|
|
|
|
* @param string $searchTerm
|
|
|
|
* @param string $searchTerm
|
|
|
|
* @param array $contacts
|
|
|
|
* @param array $contacts
|
|
|
|
* @param bool $shareeEnumeration
|
|
|
|
* @param bool $shareeEnumeration
|
|
|
|
* @param array $expected
|
|
|
|
* @param array $expectedResult
|
|
|
|
* @param bool $exactIdMatch
|
|
|
|
* @param bool $expectedExactIdMatch
|
|
|
|
* @param bool $reachedEnd
|
|
|
|
* @param bool $expectedMoreResults
|
|
|
|
* @param bool $validEmail
|
|
|
|
* @param bool $validEmail
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#[\PHPUnit\Framework\Attributes\DataProvider('dataGetEmail')]
|
|
|
|
#[\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())
|
|
|
|
$this->config->expects($this->any())
|
|
|
|
->method('getAppValue')
|
|
|
|
->method('getAppValue')
|
|
|
|
->willReturnCallback(
|
|
|
|
->willReturnCallback(
|
|
|
|
@ -127,9 +127,9 @@ class MailPluginTest extends TestCase {
|
|
|
|
$moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult);
|
|
|
|
$moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult);
|
|
|
|
$result = $this->searchResult->asArray();
|
|
|
|
$result = $this->searchResult->asArray();
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertSame($exactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails')));
|
|
|
|
$this->assertSame($expectedExactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails')));
|
|
|
|
$this->assertEquals($expected, $result);
|
|
|
|
$this->assertEquals($expectedResult, $result);
|
|
|
|
$this->assertSame($reachedEnd, $moreResults);
|
|
|
|
$this->assertSame($expectedMoreResults, $moreResults);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static function dataGetEmail(): array {
|
|
|
|
public static function dataGetEmail(): array {
|
|
|
|
@ -569,14 +569,14 @@ class MailPluginTest extends TestCase {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param string $searchTerm
|
|
|
|
* @param string $searchTerm
|
|
|
|
* @param array $contacts
|
|
|
|
* @param array $contacts
|
|
|
|
* @param array $expected
|
|
|
|
* @param array $expectedResult
|
|
|
|
* @param bool $exactIdMatch
|
|
|
|
* @param bool $expectedExactIdMatch
|
|
|
|
* @param bool $reachedEnd
|
|
|
|
* @param bool $expectedMoreResults
|
|
|
|
* @param array $userToGroupMapping
|
|
|
|
* @param array $userToGroupMapping
|
|
|
|
* @param bool $validEmail
|
|
|
|
* @param bool $validEmail
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#[\PHPUnit\Framework\Attributes\DataProvider('dataGetEmailGroupsOnly')]
|
|
|
|
#[\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())
|
|
|
|
$this->config->expects($this->any())
|
|
|
|
->method('getAppValue')
|
|
|
|
->method('getAppValue')
|
|
|
|
->willReturnCallback(
|
|
|
|
->willReturnCallback(
|
|
|
|
@ -627,9 +627,9 @@ class MailPluginTest extends TestCase {
|
|
|
|
$moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult);
|
|
|
|
$moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult);
|
|
|
|
$result = $this->searchResult->asArray();
|
|
|
|
$result = $this->searchResult->asArray();
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertSame($exactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails')));
|
|
|
|
$this->assertSame($expectedExactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails')));
|
|
|
|
$this->assertEquals($expected, $result);
|
|
|
|
$this->assertEquals($expectedResult, $result);
|
|
|
|
$this->assertSame($reachedEnd, $moreResults);
|
|
|
|
$this->assertSame($expectedMoreResults, $moreResults);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static function dataGetEmailGroupsOnly(): array {
|
|
|
|
public static function dataGetEmailGroupsOnly(): array {
|
|
|
|
|