@@ -120,7 +120,7 @@ public function testGetPrincipalsByPrefixWithUsers(): void {
120120 ->willReturn ('Dr. Foo-Bar ' );
121121 $ fooUser
122122 ->expects ($ this ->once ())
123- ->method ('getEMailAddress ' )
123+ ->method ('getSystemEMailAddress ' )
124124 ->willReturn ('' );
125125 $ barUser = $ this ->createMock (User::class);
126126 $ barUser
@@ -129,7 +129,7 @@ public function testGetPrincipalsByPrefixWithUsers(): void {
129129 ->willReturn ('bar ' );
130130 $ barUser
131131 ->expects ($ this ->once ())
132- ->method ('getEMailAddress ' )
132+ ->method ('getSystemEMailAddress ' )
133133 ->willReturn ('bar@nextcloud.com ' );
134134 $ this ->userManager
135135 ->expects ($ this ->once ())
@@ -205,7 +205,7 @@ public function testGetPrincipalsByPathWithMail(): void {
205205 $ fooUser = $ this ->createMock (User::class);
206206 $ fooUser
207207 ->expects ($ this ->once ())
208- ->method ('getEMailAddress ' )
208+ ->method ('getSystemEMailAddress ' )
209209 ->willReturn ('foo@nextcloud.com ' );
210210 $ fooUser
211211 ->expects ($ this ->once ())
@@ -605,15 +605,15 @@ public function testSearchPrincipalWithEnumerationDisabledDisplayname(): void {
605605 $ user2 = $ this ->createMock (IUser::class);
606606 $ user2 ->method ('getUID ' )->willReturn ('user2 ' );
607607 $ user2 ->method ('getDisplayName ' )->willReturn ('User 2 ' );
608- $ user2 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar ' );
608+ $ user2 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar ' );
609609 $ user3 = $ this ->createMock (IUser::class);
610610 $ user3 ->method ('getUID ' )->willReturn ('user3 ' );
611611 $ user2 ->method ('getDisplayName ' )->willReturn ('User 22 ' );
612- $ user2 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar123 ' );
612+ $ user2 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar123 ' );
613613 $ user4 = $ this ->createMock (IUser::class);
614614 $ user4 ->method ('getUID ' )->willReturn ('user4 ' );
615615 $ user2 ->method ('getDisplayName ' )->willReturn ('User 222 ' );
616- $ user2 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar456 ' );
616+ $ user2 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar456 ' );
617617
618618 $ this ->userManager ->expects ($ this ->at (0 ))
619619 ->method ('searchDisplayName ' )
@@ -665,20 +665,20 @@ public function testSearchPrincipalWithEnumerationDisabledEmail(): void {
665665 $ user2 = $ this ->createMock (IUser::class);
666666 $ user2 ->method ('getUID ' )->willReturn ('user2 ' );
667667 $ user2 ->method ('getDisplayName ' )->willReturn ('User 2 ' );
668- $ user2 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar ' );
668+ $ user2 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar ' );
669669 $ user3 = $ this ->createMock (IUser::class);
670670 $ user3 ->method ('getUID ' )->willReturn ('user3 ' );
671671 $ user2 ->method ('getDisplayName ' )->willReturn ('User 22 ' );
672- $ user2 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar123 ' );
672+ $ user2 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar123 ' );
673673 $ user4 = $ this ->createMock (IUser::class);
674674 $ user4 ->method ('getUID ' )->willReturn ('user4 ' );
675675 $ user2 ->method ('getDisplayName ' )->willReturn ('User 222 ' );
676- $ user2 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar456 ' );
676+ $ user2 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar456 ' );
677677
678- $ this ->userManager ->expects ($ this ->at ( 0 ))
678+ $ this ->userManager ->expects ($ this ->once ( ))
679679 ->method ('getByEmail ' )
680680 ->with ('user2@foo.bar ' )
681- ->willReturn ([$ user2, $ user3 , $ user4 ]);
681+ ->willReturn ([$ user2 ]);
682682
683683 $ this ->assertEquals (['principals/users/user2 ' ], $ this ->connector ->searchPrincipals ('principals/users ' ,
684684 ['{http://sabredav.org/ns}email-address ' => 'user2@foo.bar ' ]));
@@ -726,15 +726,15 @@ public function testSearchPrincipalWithEnumerationLimitedDisplayname(): void {
726726 $ user2 = $ this ->createMock (IUser::class);
727727 $ user2 ->method ('getUID ' )->willReturn ('user2 ' );
728728 $ user2 ->method ('getDisplayName ' )->willReturn ('User 2 ' );
729- $ user2 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar ' );
729+ $ user2 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar ' );
730730 $ user3 = $ this ->createMock (IUser::class);
731731 $ user3 ->method ('getUID ' )->willReturn ('user3 ' );
732732 $ user3 ->method ('getDisplayName ' )->willReturn ('User 22 ' );
733- $ user3 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar123 ' );
733+ $ user3 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar123 ' );
734734 $ user4 = $ this ->createMock (IUser::class);
735735 $ user4 ->method ('getUID ' )->willReturn ('user4 ' );
736736 $ user4 ->method ('getDisplayName ' )->willReturn ('User 222 ' );
737- $ user4 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar456 ' );
737+ $ user4 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar456 ' );
738738
739739
740740 $ this ->userSession ->expects ($ this ->at (0 ))
@@ -787,15 +787,15 @@ public function testSearchPrincipalWithEnumerationLimitedMail(): void {
787787 $ user2 = $ this ->createMock (IUser::class);
788788 $ user2 ->method ('getUID ' )->willReturn ('user2 ' );
789789 $ user2 ->method ('getDisplayName ' )->willReturn ('User 2 ' );
790- $ user2 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar ' );
790+ $ user2 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar ' );
791791 $ user3 = $ this ->createMock (IUser::class);
792792 $ user3 ->method ('getUID ' )->willReturn ('user3 ' );
793793 $ user3 ->method ('getDisplayName ' )->willReturn ('User 22 ' );
794- $ user3 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar123 ' );
794+ $ user3 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar123 ' );
795795 $ user4 = $ this ->createMock (IUser::class);
796796 $ user4 ->method ('getUID ' )->willReturn ('user4 ' );
797797 $ user4 ->method ('getDisplayName ' )->willReturn ('User 222 ' );
798- $ user4 ->method ('getEMailAddress ' )->willReturn ('user2@foo.bar456 ' );
798+ $ user4 ->method ('getSystemEMailAddress ' )->willReturn ('user2@foo.bar456 ' );
799799
800800
801801 $ this ->userSession ->expects ($ this ->at (0 ))
0 commit comments