ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCertificateObjectsForUserPreloaderTest Class Reference
+ Inheritance diagram for ilCertificateObjectsForUserPreloaderTest:
+ Collaboration diagram for ilCertificateObjectsForUserPreloaderTest:

Public Member Functions

 testUsersWithCertifcatesWillBePreoloaded ()
 
 testUserWithCertificateIsNotPreloaded ()
 
 testUserIsNoProloaded ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilCertificateBaseTestCase
 setUp ()
 
 tearDown ()
 
 assertDoesNotThrow (callable $cb, string $message='')
 
 assertThrows (callable $cb, ?string $expected_class=null, ?string $expected_message=null)
 @template T of Throwable More...
 
 setGlobalVariable (string $name, mixed $value)
 
- Protected Attributes inherited from ilCertificateBaseTestCase
Container $dic
 

Detailed Description

Definition at line 21 of file ilCertificateObjectsForUserPreloaderTest.php.

Member Function Documentation

◆ testUserIsNoProloaded()

ilCertificateObjectsForUserPreloaderTest::testUserIsNoProloaded ( )

Definition at line 59 of file ilCertificateObjectsForUserPreloaderTest.php.

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

◆ testUsersWithCertifcatesWillBePreoloaded()

ilCertificateObjectsForUserPreloaderTest::testUsersWithCertifcatesWillBePreoloaded ( )

Definition at line 23 of file ilCertificateObjectsForUserPreloaderTest.php.

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

◆ testUserWithCertificateIsNotPreloaded()

ilCertificateObjectsForUserPreloaderTest::testUserWithCertificateIsNotPreloaded ( )

Definition at line 41 of file ilCertificateObjectsForUserPreloaderTest.php.

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

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