getContainer()->get('doctrine.orm.entity_manager'); $connection = $entityManager->getConnection(); $this->userRepository = new UserRepository($entityManager, $connection); } public function testCountFilteredUsers(): void { self::assertIsInt($this->userRepository->countFilteredUsers(null, ['Active'])); self::assertIsInt($this->userRepository->countFilteredUsers(null, ['Active', 'Inactive'])); self::assertIsInt($this->userRepository->countFilteredUsers(null, ['Inactive'])); self::assertIsInt($this->userRepository->countFilteredUsers('center', ['Active'])); self::assertIsInt($this->userRepository->countFilteredUsers('center', ['Active', 'Inactive'])); self::assertIsInt($this->userRepository->countFilteredUsers('center', ['Inactive'])); self::assertIsInt($this->userRepository->countFilteredUsers('center')); } public function testFindByFilteredUsers(): void { self::assertIsArray($this->userRepository->findFilteredUsers(null, ['Active'])); self::assertIsArray($this->userRepository->findFilteredUsers(null, ['Active', 'Inactive'])); self::assertIsArray($this->userRepository->findFilteredUsers(null, ['Inactive'])); self::assertIsArray($this->userRepository->findFilteredUsers('center', ['Active'])); self::assertIsArray($this->userRepository->findFilteredUsers('center', ['Active', 'Inactive'])); self::assertIsArray($this->userRepository->findFilteredUsers('center', ['Inactive'])); self::assertIsArray($this->userRepository->findFilteredUsers('center')); } }