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

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

Loading…
Cancel
Save