From eb486cc29ba4f4ca2e279948ea93753d92e6cd9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 19 Nov 2024 15:39:15 +0100 Subject: [PATCH] fix(tests): Adapt tests to firstLogin new feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- .../tests/Controller/UsersControllerTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php index d5931ef0eba75..e4b42c04651bd 100644 --- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php +++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php @@ -1147,6 +1147,10 @@ public function testGetUserDataAsAdmin(): void { ->expects($this->once()) ->method('getLastLogin') ->willReturn(1521191471); + $targetUser + ->expects($this->once()) + ->method('getFirstLogin') + ->willReturn(1511191471); $targetUser ->expects($this->once()) ->method('getBackendClassName') @@ -1169,6 +1173,7 @@ public function testGetUserDataAsAdmin(): void { 'id' => 'UID', 'enabled' => true, 'storageLocation' => '/var/www/newtcloud/data/UID', + 'firstLogin' => 1511191471000, 'lastLogin' => 1521191471000, 'backend' => 'Database', 'subadmin' => ['group3'], @@ -1273,6 +1278,10 @@ public function testGetUserDataAsSubAdminAndUserIsAccessible(): void { ->expects($this->once()) ->method('getLastLogin') ->willReturn(1521191471); + $targetUser + ->expects($this->once()) + ->method('getFirstLogin') + ->willReturn(1511191471); $targetUser ->expects($this->once()) ->method('getBackendClassName') @@ -1308,6 +1317,7 @@ public function testGetUserDataAsSubAdminAndUserIsAccessible(): void { $expected = [ 'id' => 'UID', 'enabled' => true, + 'firstLogin' => 1511191471000, 'lastLogin' => 1521191471000, 'backend' => 'Database', 'subadmin' => [], @@ -1455,6 +1465,10 @@ public function testGetUserDataAsSubAdminSelfLookup(): void { ->expects($this->once()) ->method('getLastLogin') ->willReturn(1521191471); + $targetUser + ->expects($this->once()) + ->method('getFirstLogin') + ->willReturn(1511191471); $targetUser ->expects($this->once()) ->method('getBackendClassName') @@ -1485,6 +1499,7 @@ public function testGetUserDataAsSubAdminSelfLookup(): void { $expected = [ 'id' => 'UID', + 'firstLogin' => 1511191471000, 'lastLogin' => 1521191471000, 'backend' => 'Database', 'subadmin' => [],