ILIAS  release_8 Revision v8.24
ilCertificateObjectsForUserPreloaderTest Class Reference
+ Inheritance diagram for ilCertificateObjectsForUserPreloaderTest:
+ Collaboration diagram for ilCertificateObjectsForUserPreloaderTest:

Public Member Functions

 testUsersWithCertifcatesWillBePreoloaded ()
 
 testUserWithCertificateIsNotPreloaded ()
 
 testUserIsNoProloaded ()
 

Detailed Description

Member Function Documentation

◆ testUserIsNoProloaded()

ilCertificateObjectsForUserPreloaderTest::testUserIsNoProloaded ( )

Definition at line 62 of file ilCertificateObjectsForUserPreloaderTest.php.

62 : void
63 {
64 $userCertificateRepository = $this->getMockBuilder(ilUserCertificateRepository::class)
65 ->disableOriginalConstructor()
66 ->getMock();
67
68 $userCertificateRepository->method('fetchObjectIdsWithCertificateForUser')
69 ->willReturn([1, 2, 3]);
70
71 $preloader = new ilCertificateObjectsForUserPreloader($userCertificateRepository);
72
73 $preloader->preLoad(100, [500, 200]);
74
75 $result = $preloader->isPreloaded(200, 1);
76
77 $this->assertFalse($result);
78 }

◆ testUsersWithCertifcatesWillBePreoloaded()

ilCertificateObjectsForUserPreloaderTest::testUsersWithCertifcatesWillBePreoloaded ( )

Definition at line 26 of file ilCertificateObjectsForUserPreloaderTest.php.

26 : void
27 {
28 $userCertificateRepository = $this->getMockBuilder(ilUserCertificateRepository::class)
29 ->disableOriginalConstructor()
30 ->getMock();
31
32 $userCertificateRepository->method('fetchObjectIdsWithCertificateForUser')
33 ->willReturn([1, 2, 3]);
34
35 $preloader = new ilCertificateObjectsForUserPreloader($userCertificateRepository);
36
37 $preloader->preLoad(100, [500, 200]);
38
39 $result = $preloader->isPreloaded(100, 1);
40
41 $this->assertTrue($result);
42 }

◆ testUserWithCertificateIsNotPreloaded()

ilCertificateObjectsForUserPreloaderTest::testUserWithCertificateIsNotPreloaded ( )

Definition at line 44 of file ilCertificateObjectsForUserPreloaderTest.php.

44 : void
45 {
46 $userCertificateRepository = $this->getMockBuilder(ilUserCertificateRepository::class)
47 ->disableOriginalConstructor()
48 ->getMock();
49
50 $userCertificateRepository->method('fetchObjectIdsWithCertificateForUser')
51 ->willReturn([1, 2, 3]);
52
53 $preloader = new ilCertificateObjectsForUserPreloader($userCertificateRepository);
54
55 $preloader->preLoad(100, [500, 200]);
56
57 $result = $preloader->isPreloaded(100, 5);
58
59 $this->assertFalse($result);
60 }

The documentation for this class was generated from the following file: