Skip to content

Commit

Permalink
fix(tests): Adapt tests to firstLogin new feature
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Nov 19, 2024
1 parent eeaa2dc commit eb486cc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/provisioning_api/tests/Controller/UsersControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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'],
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -1308,6 +1317,7 @@ public function testGetUserDataAsSubAdminAndUserIsAccessible(): void {
$expected = [
'id' => 'UID',
'enabled' => true,
'firstLogin' => 1511191471000,
'lastLogin' => 1521191471000,
'backend' => 'Database',
'subadmin' => [],
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -1485,6 +1499,7 @@ public function testGetUserDataAsSubAdminSelfLookup(): void {

$expected = [
'id' => 'UID',
'firstLogin' => 1511191471000,
'lastLogin' => 1521191471000,
'backend' => 'Database',
'subadmin' => [],
Expand Down

0 comments on commit eb486cc

Please sign in to comment.