@@ -695,7 +695,6 @@ public function testGetUserAsAdmin() {
695695 ->with ('UserToGet ' )
696696 ->will ($ this ->returnValue (['DummyValue ' ]));
697697 $ targetUser
698- ->expects ($ this ->once ())
699698 ->method ('getUID ' )
700699 ->will ($ this ->returnValue ('UserToGet ' ));
701700 $ targetUser
@@ -710,6 +709,11 @@ public function testGetUserAsAdmin() {
710709 ->expects ($ this ->once ())
711710 ->method ('getLastLogin ' )
712711 ->willReturn ('1618230656 ' );
712+ $ this ->config
713+ ->expects ($ this ->once ())
714+ ->method ('getUserValue ' )
715+ ->with ($ targetUser ->getUID (), 'core ' , 'lang ' )
716+ ->willReturn ('de ' );
713717
714718 $ expected = new Result (
715719 [
@@ -719,7 +723,8 @@ public function testGetUserAsAdmin() {
719723 'displayname ' => 'Demo User ' ,
720724 'home ' => '/var/ocdata/UserToGet ' ,
721725 'two_factor_auth_enabled ' => 'false ' ,
722- 'last_login ' => '1618230656 '
726+ 'last_login ' => '1618230656 ' ,
727+ 'language ' => 'de '
723728 ]
724729 );
725730 $ this ->assertEquals ($ expected , $ this ->api ->getUser (['userid ' => 'UserToGet ' ]));
@@ -764,7 +769,6 @@ public function testGetUserAsSubAdminAndUserIsAccessible() {
764769 ->method ('getDisplayName ' )
765770 ->will ($ this ->returnValue ('Demo User ' ));
766771 $ targetUser
767- ->expects ($ this ->once ())
768772 ->method ('getUID ' )
769773 ->will ($ this ->returnValue ('UserToGet ' ));
770774 $ targetUser
@@ -775,6 +779,11 @@ public function testGetUserAsSubAdminAndUserIsAccessible() {
775779 ->expects ($ this ->once ())
776780 ->method ('getLastLogin ' )
777781 ->willReturn ('1618230656 ' );
782+ $ this ->config
783+ ->expects ($ this ->once ())
784+ ->method ('getUserValue ' )
785+ ->with ($ targetUser ->getUID (), 'core ' , 'lang ' )
786+ ->willReturn ('de ' );
778787
779788 $ expected = new Result (
780789 [
@@ -784,7 +793,8 @@ public function testGetUserAsSubAdminAndUserIsAccessible() {
784793 'home ' => '/var/ocdata/UserToGet ' ,
785794 'displayname ' => 'Demo User ' ,
786795 'two_factor_auth_enabled ' => 'false ' ,
787- 'last_login ' => '1618230656 '
796+ 'last_login ' => '1618230656 ' ,
797+ 'language ' => 'de '
788798 ]
789799 );
790800 $ this ->assertEquals ($ expected , $ this ->api ->getUser (['userid ' => 'UserToGet ' ]));
@@ -852,7 +862,6 @@ public function testGetUserAsSubAdminSelfLookup() {
852862 ->method ('getDisplayName ' )
853863 ->will ($ this ->returnValue ('Subadmin User ' ));
854864 $ targetUser
855- ->expects ($ this ->once ())
856865 ->method ('getUID ' )
857866 ->will ($ this ->returnValue ('subadmin ' ));
858867 $ targetUser
@@ -863,14 +872,20 @@ public function testGetUserAsSubAdminSelfLookup() {
863872 ->expects ($ this ->once ())
864873 ->method ('getLastLogin ' )
865874 ->willReturn ('1618230656 ' );
875+ $ this ->config
876+ ->expects ($ this ->once ())
877+ ->method ('getUserValue ' )
878+ ->with ($ targetUser ->getUID (), 'core ' , 'lang ' )
879+ ->willReturn ('de ' );
866880
867881 $ expected = new Result ([
868882 'quota ' => ['DummyValue ' , 'definition ' => null ],
869883 'email ' => 'subadmin@owncloud.com ' ,
870884 'displayname ' => 'Subadmin User ' ,
871885 'home ' => '/var/ocdata/UserToGet ' ,
872886 'two_factor_auth_enabled ' => 'false ' ,
873- 'last_login ' => '1618230656 '
887+ 'last_login ' => '1618230656 ' ,
888+ 'language ' => 'de '
874889 ]);
875890 $ this ->assertEquals ($ expected , $ this ->api ->getUser (['userid ' => 'subadmin ' ]));
876891 }
0 commit comments