19 declare(strict_types=1);
28 $userCertificateRepository = $this->getMockBuilder(ilUserCertificateRepository::class)
29 ->disableOriginalConstructor()
32 $userCertificateRepository->method(
'fetchObjectIdsWithCertificateForUser')
33 ->willReturn([1, 2, 3]);
37 $preloader->preLoad(100, [500, 200]);
39 $result = $preloader->isPreloaded(100, 1);
41 $this->assertTrue($result);
46 $userCertificateRepository = $this->getMockBuilder(ilUserCertificateRepository::class)
47 ->disableOriginalConstructor()
50 $userCertificateRepository->method(
'fetchObjectIdsWithCertificateForUser')
51 ->willReturn([1, 2, 3]);
55 $preloader->preLoad(100, [500, 200]);
57 $result = $preloader->isPreloaded(100, 5);
59 $this->assertFalse($result);
64 $userCertificateRepository = $this->getMockBuilder(ilUserCertificateRepository::class)
65 ->disableOriginalConstructor()
68 $userCertificateRepository->method(
'fetchObjectIdsWithCertificateForUser')
69 ->willReturn([1, 2, 3]);
73 $preloader->preLoad(100, [500, 200]);
75 $result = $preloader->isPreloaded(200, 1);
77 $this->assertFalse($result);
Class ilCertificateBaseTestCase.
testUserWithCertificateIsNotPreloaded()
testUsersWithCertifcatesWillBePreoloaded()