checker = new UserChecker(); } public function testCheckPreAuthActiveUser() { $user = $this->createMock(Account::class); $user->method('isActif')->willReturn(true); $this->checker->checkPreAuth($user); $this->assertTrue(true); // No exception thrown } public function testCheckPreAuthInactiveUserThrowsException() { $user = $this->createMock(Account::class); $user->method('isActif')->willReturn(false); $this->expectException(CustomUserMessageAccountStatusException::class); $this->expectExceptionMessage('Votre compte a été désactivé.'); $this->checker->checkPreAuth($user); } public function testCheckPreAuthNonAccountUserIgnores() { $user = $this->createMock(UserInterface::class); $this->checker->checkPreAuth($user); $this->assertTrue(true); } }