ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMailAddressTypesTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
28 {
29  protected function setUp(): void
30  {
31  parent::setUp();
33  }
34 
39  {
40  return $this->getMockBuilder(ilGroupNameAsMailValidator::class)
41  ->disableOriginalConstructor()
42  ->onlyMethods(['validate'])
43  ->getMock();
44  }
45 
47  {
48  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
49  $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock();
50  $rbacreview = $this->getMockBuilder(ilRbacReview::class)->disableOriginalConstructor()->getMock();
51  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
52  $mailingLists = $this->getMockBuilder(ilMailingLists::class)->disableOriginalConstructor()->getMock();
53  $roleMailboxSearch = $this->getMockBuilder(ilRoleMailboxSearch::class)->disableOriginalConstructor()->getMock();
54 
55  return new ilMailAddressTypeFactory(
56  $groupNameValidatorMock,
57  $logger,
58  $rbacsystem,
59  $rbacreview,
60  $addressTypeHelper,
61  $mailingLists,
62  $roleMailboxSearch
63  );
64  }
65 
67  {
68  if ($type instanceof ilMailCachedAddressType) {
69  $refl = new ReflectionObject($type);
70  $inner = $refl->getProperty('inner');
71  $inner->setAccessible(true);
72 
73  return $inner->getValue($type);
74  }
75 
76  return $type;
77  }
78 
80  {
81  $groupNameValidatorMock = $this->createGroupNameAsValidatorMock();
82  $groupNameValidatorMock->method('validate')->willReturn(true);
83 
84  $mailAddressTypeFactory = $this->getAddressTypeFactory($groupNameValidatorMock);
85 
86  $result = $mailAddressTypeFactory->getByPrefix(new ilMailAddress('#il_ml_4711', ''), false);
87 
88  $this->assertInstanceOf('ilMailMailingListAddressType', $this->getWrappedAddressType($result));
89  }
90 
92  {
93  $groupNameValidatorMock = $this->createGroupNameAsValidatorMock();
94  $groupNameValidatorMock->method('validate')->willReturn(true);
95 
96  $mailAddressTypeFactory = $this->getAddressTypeFactory($groupNameValidatorMock);
97 
98  $result = $mailAddressTypeFactory->getByPrefix(new ilMailAddress('#MyGroup', ''), false);
99 
100  $this->assertInstanceOf('ilMailGroupAddressType', $this->getWrappedAddressType($result));
101  }
102 
104  {
105  $groupNameValidatorMock = $this->createGroupNameAsValidatorMock();
106  $groupNameValidatorMock->method('validate')->willReturn(false);
107 
108  $mailAddressTypeFactory = $this->getAddressTypeFactory($groupNameValidatorMock);
109 
110  $result = $mailAddressTypeFactory->getByPrefix(new ilMailAddress('phpunit', ''), false);
111 
112  $this->assertInstanceOf('ilMailLoginOrEmailAddressAddressType', $this->getWrappedAddressType($result));
113  }
114 
115  public function testFactoryWillReturnRoleAddressType(): void
116  {
117  $groupNameValidatorMock = $this->createGroupNameAsValidatorMock();
118  $groupNameValidatorMock->method('validate')->willReturn(false);
119 
120  $mailAddressTypeFactory = $this->getAddressTypeFactory($groupNameValidatorMock);
121 
122  $result = $mailAddressTypeFactory->getByPrefix(new ilMailAddress('#member', ''), false);
123 
124  $this->assertInstanceOf('ilMailRoleAddressType', $this->getWrappedAddressType($result));
125  }
126 
128  {
129  $groupNameValidatorMock = $this->createGroupNameAsValidatorMock();
130  $groupNameValidatorMock->method('validate')->willReturn(false);
131 
132  $mailAddressTypeFactory = $this->getAddressTypeFactory($groupNameValidatorMock);
133 
134  $result = $mailAddressTypeFactory->getByPrefix(new ilMailAddress('#il_grp_admin_98', ''), false);
135 
136  $this->assertInstanceOf('ilMailRoleAddressType', $this->getWrappedAddressType($result));
137  }
138 
140  {
141  $groupNameValidatorMock = $this->createGroupNameAsValidatorMock();
142  $groupNameValidatorMock->method('validate')->willReturn(false);
143 
144  $mailAddressTypeFactory = $this->getAddressTypeFactory($groupNameValidatorMock);
145 
146  $result = $mailAddressTypeFactory->getByPrefix(new ilMailAddress('#il_grp_member_98', ''), false);
147 
148  $this->assertInstanceOf('ilMailRoleAddressType', $this->getWrappedAddressType($result));
149  }
150 
152  {
153  $groupNameValidatorMock = $this->createGroupNameAsValidatorMock();
154  $groupNameValidatorMock->method('validate')->willReturn(false);
155 
156  $mailAddressTypeFactory = $this->getAddressTypeFactory($groupNameValidatorMock);
157 
158  $result = $mailAddressTypeFactory->getByPrefix(new ilMailAddress('#il_crs_admin_98', ''), false);
159 
160  $this->assertInstanceOf('ilMailRoleAddressType', $this->getWrappedAddressType($result));
161  }
162 
164  {
165  $groupNameValidatorMock = $this->createGroupNameAsValidatorMock();
166  $groupNameValidatorMock->method('validate')->willReturn(false);
167 
168  $mailAddressTypeFactory = $this->getAddressTypeFactory($groupNameValidatorMock);
169 
170  $result = $mailAddressTypeFactory->getByPrefix(new ilMailAddress('#il_crs_member_98', ''), false);
171 
172  $this->assertInstanceOf('ilMailRoleAddressType', $this->getWrappedAddressType($result));
173  }
174 
176  {
177  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
178  $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock();
179  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
180 
181  $addressTypeHelper->expects($this->once())->method('getInstallationHost')->willReturn('ilias');
182  $addressTypeHelper->expects($this->once())->method('getUserIdByLogin')->willReturn(4711);
183 
185  $addressTypeHelper,
186  new ilMailAddress('phpunit', 'ilias'),
187  $logger,
188  $rbacsystem
189  );
190 
191  $usrIds = $type->resolve();
192 
193  $this->assertCount(1, $usrIds);
194  $this->assertArrayHasKey(0, $usrIds);
195  $this->assertSame(4711, $usrIds[0]);
196  }
197 
199  {
200  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
201  $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock();
202  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
203 
204  $addressTypeHelper->expects($this->once())->method('getInstallationHost')->willReturn('ilias');
205  $addressTypeHelper->expects($this->once())->method('getUserIdByLogin')->willReturn(0);
206 
208  $addressTypeHelper,
209  new ilMailAddress('phpunit', 'ilias'),
210  $logger,
211  $rbacsystem
212  );
213 
214  $usrIds = $type->resolve();
215 
216  $this->assertCount(0, $usrIds);
217  }
218 
220  {
221  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
222  $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock();
223  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
224 
225  $addressTypeHelper->expects($this->once())->method('getInstallationHost')->willReturn('ilias');
226  $addressTypeHelper->expects($this->once())->method('getUserIdByLogin')->willReturn(0);
227 
229  $addressTypeHelper,
230  new ilMailAddress('mjansen', 'databay.de'),
231  $logger,
232  $rbacsystem
233  );
234 
235  $usrIds = $type->resolve();
236 
237  $this->assertCount(0, $usrIds);
238  }
239 
241  {
242  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
243  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
244 
245  $addressTypeHelper->expects($this->atLeast(3))->method('getInstallationHost')->willReturn('ilias');
246  $addressTypeHelper->expects($this->exactly(2))->method('getUserIdByLogin')->willReturnOnConsecutiveCalls(
247  4711,
248  4711,
249  0
250  );
251 
252  $addressTypeHelper->method('receivesInternalMailsOnly')->willReturn(true);
253 
254  $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock();
255  $rbacsystem->expects($this->exactly(2))->method('checkAccessOfUser')->willReturnOnConsecutiveCalls(
256  true,
257  false
258  );
259 
261  $addressTypeHelper,
262  new ilMailAddress('phpunit', 'ilias'),
263  $logger,
264  $rbacsystem
265  );
266  $this->assertTrue($type->validate(666));
267  $this->assertCount(0, $type->getErrors());
268 
269  $this->assertFalse($type->validate(666));
270  $this->assertArrayHasKey(0, $type->getErrors());
271  $this->assertSame('user_cant_receive_mail', $type->getErrors()[0]->getLanguageVariable());
272 
274  $addressTypeHelper,
275  new ilMailAddress('mjansen', 'databay.de'),
276  $logger,
277  $rbacsystem
278  );
279  $this->assertTrue($type->validate(666));
280  $this->assertCount(0, $type->getErrors());
281  }
282 
284  {
285  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
286  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
287 
288  $group = $this->getMockBuilder(ilObjGroup::class)->disableOriginalConstructor()->onlyMethods(['getGroupMemberIds'])->getMock();
289  $group->expects($this->once())->method('getGroupMemberIds')->willReturn([666, 777]);
290 
291  $addressTypeHelper->expects($this->once())->method('getGroupObjIdByTitle')->willReturn(1);
292  $addressTypeHelper->expects($this->once())->method('getAllRefIdsForObjId')->with(1)->willReturn([2]);
293  $addressTypeHelper->expects($this->once())->method('getInstanceByRefId')->with(2)->willReturn($group);
294 
295  $type = new ilMailGroupAddressType(
296  $addressTypeHelper,
297  new ilMailAddress('#PhpUnit', ''),
298  $logger
299  );
300 
301  $usrIds = $type->resolve();
302 
303  $this->assertCount(2, $usrIds);
304  }
305 
307  {
308  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
309  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
310 
311  $group = $this->getMockBuilder(ilObjGroup::class)->disableOriginalConstructor()->onlyMethods(['getGroupMemberIds'])->getMock();
312  $group->expects($this->never())->method('getGroupMemberIds');
313 
314  $addressTypeHelper->expects($this->once())->method('getGroupObjIdByTitle')->willReturn(0);
315  $addressTypeHelper->expects($this->once())->method('getAllRefIdsForObjId')->with(0)->willReturn([]);
316  $addressTypeHelper->expects($this->never())->method('getInstanceByRefId');
317 
318  $type = new ilMailGroupAddressType(
319  $addressTypeHelper,
320  new ilMailAddress('#PhpUnit', ''),
321  $logger
322  );
323 
324  $usrIds = $type->resolve();
325 
326  $this->assertCount(0, $usrIds);
327  }
328 
330  {
331  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
332  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
333 
334  $addressTypeHelper->expects($this->once())->method('doesGroupNameExists')->with('PhpUnit')->willReturn(false);
335 
336  $type = new ilMailGroupAddressType(
337  $addressTypeHelper,
338  new ilMailAddress('#PhpUnit', ''),
339  $logger
340  );
341  $this->assertFalse($type->validate(666));
342  }
343 
345  {
346  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
347  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
348 
349  $addressTypeHelper->expects($this->once())->method('doesGroupNameExists')->with('PhpUnit')->willReturn(true);
350 
351  $type = new ilMailGroupAddressType(
352  $addressTypeHelper,
353  new ilMailAddress('#PhpUnit', ''),
354  $logger
355  );
356  $this->assertTrue($type->validate(666));
357  }
358 
360  {
361  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
362  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
363 
364  $list = $this->getMockBuilder(ilMailingList::class)->disableOriginalConstructor()->onlyMethods([
365  'getAssignedEntries',
366  ])->getMock();
367  $list->expects($this->exactly(2))->method('getAssignedEntries')->willReturnOnConsecutiveCalls(
368  [['usr_id' => 1], ['usr_id' => 2], ['usr_id' => 3]],
369  []
370  );
371 
372  $lists = $this->getMockBuilder(ilMailingLists::class)->disableOriginalConstructor()->onlyMethods([
373  'mailingListExists',
374  'getCurrentMailingList',
375  ])->getMock();
376  $lists->expects($this->exactly(3))->method('mailingListExists')->with('#il_ml_4711')->willReturnOnConsecutiveCalls(
377  true,
378  true,
379  false
380  );
381  $lists->expects($this->exactly(2))->method('getCurrentMailingList')->willReturn($list);
382 
383  $type = new ilMailMailingListAddressType(
384  $addressTypeHelper,
385  new ilMailAddress('#il_ml_4711', ''),
386  $logger,
387  $lists
388  );
389 
390  $usrIds = $type->resolve();
391 
392  $this->assertCount(3, $usrIds);
393 
394  $usrIds = $type->resolve();
395 
396  $this->assertCount(0, $usrIds);
397 
398  $usrIds = $type->resolve();
399 
400  $this->assertCount(0, $usrIds);
401  }
402 
403  public function testMailingListAddressCanBeValidated(): void
404  {
405  $lists = $this->getMockBuilder(ilMailingLists::class)->disableOriginalConstructor()->onlyMethods([
406  'mailingListExists',
407  ])->getMock();
408  $lists->expects($this->exactly(2))->method('mailingListExists')->with('#il_ml_4711')->willReturnOnConsecutiveCalls(
409  true,
410  false
411  );
412  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
413  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
414 
415  $type = new ilMailMailingListAddressType(
416  $addressTypeHelper,
417  new ilMailAddress('#il_ml_4711', ''),
418  $logger,
419  $lists
420  );
421 
422  $this->assertTrue($type->validate(666));
423  $this->assertCount(0, $type->getErrors());
424 
425  $this->assertFalse($type->validate(666));
426  $this->assertCount(1, $type->getErrors());
427  $this->assertArrayHasKey(0, $type->getErrors());
428  $this->assertSame('mail_no_valid_mailing_list', $type->getErrors()[0]->getLanguageVariable());
429  }
430 
432  {
433  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
434  $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock();
435  $rbacreview = $this->getMockBuilder(ilRbacReview::class)->disableOriginalConstructor()->onlyMethods(['assignedUsers'])->getMock();
436  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
437  $roleMailboxSearch = $this->getMockBuilder(ilRoleMailboxSearch::class)->disableOriginalConstructor()->onlyMethods(['searchRoleIdsByAddressString'])->getMock();
438 
439  $roleMailboxSearch->expects($this->once())->method('searchRoleIdsByAddressString')->willReturn([1, 2, 3]);
440  $rbacreview->expects($this->exactly(3))->method('assignedUsers')->willReturnOnConsecutiveCalls(
441  [4, 5, 6],
442  [7, 8],
443  [9]
444  );
445 
446  $type = new ilMailRoleAddressType(
447  $addressTypeHelper,
448  new ilMailAddress('phpunit', 'ilias'),
449  $roleMailboxSearch,
450  $logger,
451  $rbacsystem,
452  $rbacreview
453  );
454 
455  $usrIds = $type->resolve();
456 
457  $this->assertCount(6, $usrIds);
458  }
459 
461  {
462  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
463  $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock();
464  $rbacreview = $this->getMockBuilder(ilRbacReview::class)->disableOriginalConstructor()->onlyMethods(['assignedUsers'])->getMock();
465  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
466  $roleMailboxSearch = $this->getMockBuilder(ilRoleMailboxSearch::class)->disableOriginalConstructor()->onlyMethods(['searchRoleIdsByAddressString'])->getMock();
467 
468  $roleMailboxSearch->expects($this->once())->method('searchRoleIdsByAddressString')->willReturn([]);
469  $rbacreview->expects($this->never())->method('assignedUsers');
470 
471  $type = new ilMailRoleAddressType(
472  $addressTypeHelper,
473  new ilMailAddress('phpunit', 'ilias'),
474  $roleMailboxSearch,
475  $logger,
476  $rbacsystem,
477  $rbacreview
478  );
479 
480  $usrIds = $type->resolve();
481 
482  $this->assertCount(0, $usrIds);
483  }
484 
486  {
487  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
488  $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock();
489  $rbacreview = $this->getMockBuilder(ilRbacReview::class)->disableOriginalConstructor()->onlyMethods(['assignedUsers'])->getMock();
490  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
491  $roleMailboxSearch = $this->getMockBuilder(ilRoleMailboxSearch::class)->disableOriginalConstructor()->onlyMethods(['searchRoleIdsByAddressString'])->getMock();
492 
493  $roleMailboxSearch->expects($this->once())->method('searchRoleIdsByAddressString')->willReturn([1]);
494  $rbacreview->expects($this->once())->method('assignedUsers')->willReturn([]);
495 
496  $type = new ilMailRoleAddressType(
497  $addressTypeHelper,
498  new ilMailAddress('phpunit', 'ilias'),
499  $roleMailboxSearch,
500  $logger,
501  $rbacsystem,
502  $rbacreview
503  );
504 
505  $usrIds = $type->resolve();
506 
507  $this->assertCount(0, $usrIds);
508  }
509 
511  {
512  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
513  $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock();
514  $rbacreview = $this->getMockBuilder(ilRbacReview::class)->disableOriginalConstructor()->getMock();
515  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
516  $roleMailboxSearch = $this->getMockBuilder(ilRoleMailboxSearch::class)->disableOriginalConstructor()->onlyMethods(['searchRoleIdsByAddressString'])->getMock();
517 
518  $roleMailboxSearch->expects($this->once())->method('searchRoleIdsByAddressString')->willReturnOnConsecutiveCalls([1]);
519  $rbacsystem->expects($this->never())->method('checkAccessOfUser');
520 
521  $type = new ilMailRoleAddressType(
522  $addressTypeHelper,
523  new ilMailAddress('phpunit', 'ilias'),
524  $roleMailboxSearch,
525  $logger,
526  $rbacsystem,
527  $rbacreview
528  );
529 
530  $this->assertTrue($type->validate(ANONYMOUS_USER_ID));
531  $this->assertCount(0, $type->getErrors());
532  }
533 
535  {
536  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
537  $rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->onlyMethods(['checkAccessOfUser'])->getMock();
538  $rbacreview = $this->getMockBuilder(ilRbacReview::class)->disableOriginalConstructor()->onlyMethods(['isGlobalRole'])->getMock();
539  $addressTypeHelper = $this->getMockBuilder(ilMailAddressTypeHelper::class)->getMock();
540  $roleMailboxSearch = $this->getMockBuilder(ilRoleMailboxSearch::class)->disableOriginalConstructor()->onlyMethods(['searchRoleIdsByAddressString'])->getMock();
541 
542  $roleMailboxSearch->expects($this->exactly(4))->method('searchRoleIdsByAddressString')->willReturnOnConsecutiveCalls(
543  [1],
544  [],
545  [1, 2],
546  [1]
547  );
548  $rbacsystem->expects($this->exactly(4))->method('checkAccessOfUser')->willReturnOnConsecutiveCalls(
549  false,
550  true,
551  true,
552  true
553  );
554  $rbacreview->expects($this->once())->method('isGlobalRole')->with(1)->willReturn(true);
555 
556  $type = new ilMailRoleAddressType(
557  $addressTypeHelper,
558  new ilMailAddress('phpunit', 'ilias'),
559  $roleMailboxSearch,
560  $logger,
561  $rbacsystem,
562  $rbacreview
563  );
564 
565  $this->assertFalse($type->validate(4711));
566  $this->assertCount(1, $type->getErrors());
567  $this->assertArrayHasKey(0, $type->getErrors());
568  $this->assertSame('mail_to_global_roles_not_allowed', $type->getErrors()[0]->getLanguageVariable());
569 
570  $this->assertFalse($type->validate(4711));
571  $this->assertCount(1, $type->getErrors());
572  $this->assertArrayHasKey(0, $type->getErrors());
573  $this->assertSame('mail_recipient_not_found', $type->getErrors()[0]->getLanguageVariable());
574 
575  $this->assertFalse($type->validate(4711));
576  $this->assertCount(1, $type->getErrors());
577  $this->assertArrayHasKey(0, $type->getErrors());
578  $this->assertSame('mail_multiple_role_recipients_found', $type->getErrors()[0]->getLanguageVariable());
579 
580  $this->assertTrue($type->validate(4711));
581  $this->assertCount(0, $type->getErrors());
582  }
583 
585  {
586  $origin = $this->getMockBuilder(ilMailAddressType::class)->getMock();
587 
588  $origin->expects($this->once())->method('resolve');
589  $origin->expects($this->once())->method('validate');
590 
591  $type = new ilMailCachedAddressType($origin, true);
592  $type->resolve();
593  $type->resolve();
594 
595  $type->validate(6);
596  $type->validate(6);
597  }
598 
600  {
601  $origin = $this->getMockBuilder(ilMailAddressType::class)->getMock();
602 
603  $origin->expects($this->exactly(3))->method('resolve');
604  $origin->expects($this->exactly(3))->method('validate');
605 
606  $type = new ilMailCachedAddressType($origin, false);
607  $type->resolve();
608  $type->resolve();
609  $type->resolve();
610 
611  $type->validate(6);
612  $type->validate(6);
613  $type->validate(6);
614  }
615 }
testNoUserIdsCanBeResolvedFromRoleAddressWithoutAnyUsersBeingAssinged()
const ANONYMOUS_USER_ID
Definition: constants.php:27
testPermissionsAreCheckedForRegularUsersWhenValidatingGlobalRoleAddresses()
Class ilGroupNameAsMailValidator.
Class ilMailMailingListAddressType.
testCacheOnlyResolvesAndValidatesRecipientsOnceIfCachingIsEnabled()
testValidationForAnonymousUserAsSystemActorSucceedsAlwaysForGlobalRoleAddresses()
Class ilMailBaseTest.
Interface ilMailAddressType.
Class ilMailAddressTypesTest.
getAddressTypeFactory(ilGroupNameAsMailValidator $groupNameValidatorMock)
Class ilMailCachedAddressType.
Class ilMailRoleAddressType.
Class ilMailGroupAddressType.
testCacheResolvesAndValidatesRecipientsOnEveryCallIfCachingIsDisabled()
getWrappedAddressType(ilMailAddressType $type)
Class ilMailAddressTypeFactory.
Class ilMailAddress.