File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515use OC \User \User ;
1616use OCP \Config \IUserConfig ;
1717use OCP \EventDispatcher \IEventDispatcher ;
18+ use OCP \Federation \ICloudId ;
1819use OCP \ICache ;
1920use OCP \ICacheFactory ;
2021use OCP \IConfig ;
@@ -762,4 +763,18 @@ public function testGetExistingUser() {
762763 $ this ->assertEquals ('nobody ' , $ user ->getUID ());
763764 $ this ->assertEquals ('None ' , $ user ->getDisplayName ());
764765 }
766+
767+ public function testGetFederatedUser (): void {
768+ $ userId = 'test@example.com ' ;
769+
770+ $ cloudId = $ this ->createMock (ICloudId::class);
771+ $ cloudId ->expects ($ this ->exactly (2 ))
772+ ->method ('getDisplayId ' )
773+ ->willReturn ($ userId );
774+
775+ $ user = $ this ->manager ->getFederatedUser ($ cloudId );
776+
777+ $ this ->assertEquals ($ userId , $ user ->getUID ());
778+ $ this ->assertEquals ($ userId , $ user ->getDisplayName ());
779+ }
765780}
You can’t perform that action at this time.
0 commit comments