ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
UploadPolicyResolverTest Class Reference
+ Inheritance diagram for UploadPolicyResolverTest:
+ Collaboration diagram for UploadPolicyResolverTest:

Public Member Functions

 testLimitedPolicy ()
 

Detailed Description

Member Function Documentation

◆ testLimitedPolicy()

UploadPolicyResolverTest::testLimitedPolicy ( )

Definition at line 28 of file UploadPolicyResolverTest.php.

References $resolver, UploadPolicy\AUDIENCE_TYPE_ALL_USERS, null, and UploadPolicy\SCOPE_DEFINITION_GLOBAL.

28  : void
29  {
30  $rbac_mock = $this->createMock(\ilRbacReview::class);
31  $user_mock = $this->createMock(\ilObjUser::class);
32 
33  $general_policy = new \UploadPolicy(
34  1,
35  'General',
36  10,
37  [],
40  true,
41  null,
42  null,
43  6,
44  new \DateTimeImmutable(),
45  new \DateTimeImmutable()
46  );
47 
48  $specifiy_policy = new \UploadPolicy(
49  1,
50  'Specific',
51  1000,
52  [],
55  true,
56  new \DateTimeImmutable('today midnight'),
57  new \DateTimeImmutable('tomorrow midnight'),
58  6,
59  new \DateTimeImmutable(),
60  new \DateTimeImmutable()
61  );
62 
63  $resolver = new \UploadPolicyResolver(
64  $rbac_mock,
65  $user_mock,
66  [$general_policy, $specifiy_policy]
67  );
68 
69  $this->assertEquals(1000, $resolver->getUserUploadSizeLimitInBytes() / 1000 / 1000);
70 
71  $specifiy_policy_expired = new \UploadPolicy(
72  1,
73  'Specific Expired',
74  1000,
75  [],
78  true,
79  null,
80  new \DateTimeImmutable('yesterday midnight'),
81  6,
82  new \DateTimeImmutable(),
83  new \DateTimeImmutable()
84  );
85 
86  $resolver = new \UploadPolicyResolver(
87  $rbac_mock,
88  $user_mock,
89  [$general_policy, $specifiy_policy_expired]
90  );
91 
92  $this->assertEquals(10, $resolver->getUserUploadSizeLimitInBytes() / 1000 / 1000);
93  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const AUDIENCE_TYPE_ALL_USERS
const SCOPE_DEFINITION_GLOBAL
foreach($components as $component) $resolver

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