CI: Fix tests about user inactive

pull/5238/head
Angel Fernando Quiroz Campos 9 months ago
parent 6d35a37ce3
commit c48412ad0d
  1. 7
      tests/CoreBundle/Repository/Node/UserRepositoryTest.php
  2. 2
      tests/CoreBundle/Repository/SessionRepositoryTest.php

@ -62,7 +62,9 @@ class UserRepositoryTest extends AbstractApiTest
$userRepo = self::getContainer()->get(UserRepository::class);
$student = $this->createUser('student');
$defaultCount = $userRepo->count([]);
$userRepo->deleteUser($student);
$userRepo->deleteUser($student); // soft delete
$this->assertSame($defaultCount, $userRepo->count([]));
$userRepo->deleteUser($student, true); // hard delete
$this->assertSame($defaultCount - 1, $userRepo->count([]));
}
@ -213,7 +215,6 @@ class UserRepositoryTest extends AbstractApiTest
->setLastname('Doe')
->setFirstname('Joe')
->setUsername('admin2')
->setEnabled(true)
->setSalt('')
->setRegistrationDate(new DateTime())
->setExpirationDate(new DateTime())
@ -222,7 +223,7 @@ class UserRepositoryTest extends AbstractApiTest
->setConfirmationToken('conf')
->setRoles(['ROLE_TEST'])
->setStatus(1)
->setActive(true)
->setActive(User::ACTIVE)
->setDateOfBirth(new DateTime())
->setBiography('bio')
->setExpired(false)

@ -255,7 +255,7 @@ class SessionRepositoryTest extends AbstractApiTest
$session->setAccessStartDate(new DateTime());
$sessionRepo->update($session);
$student->setActive(false);
$student->setActive(User::INACTIVE);
$userRepo->update($student);
$this->expectException(Exception::class);

Loading…
Cancel
Save