ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilMailTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
28 
34 {
35  private MockObject&ilDBInterface $mock_database;
37  private MockObject&ilLogger $mock_log;
39  private MockObject&ilLanguage $mock_language;
40 
45  {
46  $refineryMock = $this->getMockBuilder(Factory::class)->disableOriginalConstructor()->getMock();
47  $this->setGlobalVariable('refinery', $refineryMock);
48 
49  $legal_documents = $this->createMock(Conductor::class);
50  $this->setGlobalVariable('legalDocuments', $legal_documents);
51 
52  $senderUsrId = 666;
53  $loginToIdMap = [
54  'phpunit1' => 1,
55  'phpunit2' => 2,
56  'phpunit3' => 3,
57  'phpunit4' => 4,
58  'phpunit5' => 5,
59  'phpunit6' => 6,
60  'phpunit7' => 7,
61  ];
62 
63  $transformation = $this->createMock(Transformation::class);
64  $transformation->expects(self::exactly(count($loginToIdMap)))->method('applyTo')->willReturn(new Ok(null));
65  $legal_documents->expects(self::exactly(count($loginToIdMap)))->method('userCanReadInternalMail')->willReturn($transformation);
66 
67  $userInstanceById = [];
68  $mailOptionsById = [];
69  foreach ($loginToIdMap as $usrId) {
70  $user = $this
71  ->getMockBuilder(ilObjUser::class)
72  ->disableOriginalConstructor()
73  ->onlyMethods(['getId', 'checkTimeLimit', 'getActive'])
74  ->getMock();
75  $user->method('getId')->willReturn($usrId);
76  $user->method('getActive')->willReturn(true);
77  $user->method('checkTimeLimit')->willReturn(true);
78  $userInstanceById[$usrId] = $user;
79 
80  $mailOptions = $this
81  ->getMockBuilder(ilMailOptions::class)
82  ->disableOriginalConstructor()
83  ->onlyMethods(['getExternalEmailAddresses', 'getIncomingType'])
84  ->getMock();
85  $mailOptions->method('getExternalEmailAddresses')->willReturn([
86  'phpunit' . $usrId . '@ilias.de',
87  ]);
88  $mailOptions->method('getIncomingType')->willReturn(ilMailOptions::INCOMING_EMAIL);
89  $mailOptionsById[$usrId] = $mailOptions;
90  }
91 
92  $user = $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock();
93  ilMailMimeSenderUserById::addUserToCache($senderUsrId, $user);
94 
95  $addressTypeFactory = $this
96  ->getMockBuilder(ilMailAddressTypeFactory::class)
97  ->disableOriginalConstructor()
98  ->onlyMethods(['getByPrefix'])
99  ->getMock();
100  $addressTypeFactory
101  ->method('getByPrefix')
102  ->willReturnCallback(function ($arg) use ($loginToIdMap): object {
103  return new class ($arg, $loginToIdMap) implements ilMailAddressType {
104  protected array $loginToIdMap = [];
105 
106  public function __construct(protected ilMailAddress $address, $loginToIdMap)
107  {
108  $this->loginToIdMap = array_map(static function (int $usrId): array {
109  return [$usrId];
110  }, $loginToIdMap);
111  }
112 
113  public function resolve(): array
114  {
115  return $this->loginToIdMap[$this->address->getMailbox()] ?? [];
116  }
117 
118  public function validate(int $senderId): bool
119  {
120  return true;
121  }
122 
123  public function getErrors(): array
124  {
125  return [];
126  }
127 
128  public function getAddress(): ilMailAddress
129  {
130  return $this->address;
131  }
132  };
133  });
134 
135  $db = $this->getMockBuilder(ilDBInterface::class)->getMock();
136  $nextId = 0;
137  $db->method('nextId')->willReturnCallback(function () use (&$nextId): int {
138  ++$nextId;
139 
140  return $nextId;
141  });
142 
143  $eventHandler = $this->getMockBuilder(ilAppEventHandler::class)->disableOriginalConstructor()->getMock();
144  $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
145  $lng = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock();
146  $settings = $this->getMockBuilder(ilSetting::class)->disableOriginalConstructor()->getMock();
147  $this->setGlobalVariable('ilSetting', $settings);
148 
149  $mailFileData = $this->getMockBuilder(ilFileDataMail::class)->disableOriginalConstructor()->getMock();
150  $mailOptions = $this->getMockBuilder(ilMailOptions::class)->disableOriginalConstructor()->getMock();
151  $mailBox = $this->getMockBuilder(ilMailbox::class)->disableOriginalConstructor()->getMock();
152  $actor = $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock();
153  $mustache_factory = $this->getMockBuilder(ilMustacheFactory::class)->getMock();
154 
155  $mailService = new ilMail(
156  $senderUsrId,
157  $addressTypeFactory,
159  $eventHandler,
160  $logger,
161  $db,
162  $lng,
163  $mailFileData,
164  $mailOptions,
165  $mailBox,
166  new ilMailMimeSenderFactory($settings, $mustache_factory),
167  static function (string $login) use ($loginToIdMap): int {
168  return $loginToIdMap[$login] ?? 0;
169  },
170  $this->createMock(AutoresponderService::class),
171  0,
172  4711,
173  $actor,
174  new ilMailTemplatePlaceholderResolver(new Mustache_Engine())
175  );
176 
177  $oldTransport = ilMimeMail::getDefaultTransport();
178 
179  $mailTransport = $this
180  ->getMockBuilder(ilMailMimeTransport::class)
181  ->getMock();
182  $mailTransport->expects($this->once())->method('send')->with($this->callback(function (
183  ilMimeMail $mailer
184  ) use ($loginToIdMap): bool {
185  $totalBcc = [];
186  foreach ($mailer->getBcc() as $bcc) {
187  $totalBcc = array_filter(array_map('trim', explode(',', $bcc))) + $totalBcc;
188  }
189 
190  return count($totalBcc) === count($loginToIdMap);
191  }))->willReturn(true);
192  ilMimeMail::setDefaultTransport($mailTransport);
193 
194  $mailService->setUserInstanceById($userInstanceById);
195  $mailService->setMailOptionsByUserIdMap($mailOptionsById);
196 
197  $mail_data = new MailDeliveryData(
198  implode(',', array_slice(array_keys($loginToIdMap), 0, 3)),
199  implode(',', array_slice(array_keys($loginToIdMap), 3, 2)),
200  implode(',', array_slice(array_keys($loginToIdMap), 5, 2)),
201  'Subject',
202  'Message',
203  [],
204  false
205  );
206  $mailService->sendMail($mail_data);
207 
208  ilMimeMail::setDefaultTransport($oldTransport);
209  }
210 
211  public function testGetMailObjectReferenceId(): void
212  {
213  $refId = 364;
214  $instance = $this->create($refId);
215 
216  $this->assertSame($refId, $instance->getMailObjectReferenceId());
217  }
218 
219  public function testFormatNamesForOutput(): void
220  {
221  $instance = $this->create();
222 
223  $this->mock_language->expects(self::once())->method('txt')->with('not_available')->willReturn('not_available');
224 
225  $this->assertSame('not_available', $instance->formatNamesForOutput(''));
226  $this->assertSame('', $instance->formatNamesForOutput(','));
227  }
228 
232  public function testGetPreviousMail(array $rowData): void
233  {
234  $mailId = 3454;
235  $instance = $this->createAndExpectDatabaseCall($mailId, $rowData);
236  $this->mock_database->expects(self::once())->method('setLimit')->with(1, 0);
237  $instance->getPreviousMail($mailId);
238  }
239 
240  public function provideGetPreviousMail(): array
241  {
242  return [
243  [[]],
244  [[
245  'attachments' => '',
246  'folder_id' => '',
247  'mail_id' => '',
248  'sender_id' => '',
249  'tpl_ctx_params' => '[]',
250  'use_placeholders' => '',
251  'user_id' => ''
252  ]],
253  [[
254  'folder_id' => '',
255  'mail_id' => '',
256  'sender_id' => '',
257  'use_placeholders' => '',
258  'user_id' => ''
259  ]],
260  ];
261  }
262 
263  public function testGetNextMail(): void
264  {
265  $mailId = 8484;
266  $instance = $this->createAndExpectDatabaseCall($mailId, []);
267  $this->mock_database->expects(self::once())->method('setLimit')->with(1, 0);
268  $instance->getNextMail($mailId);
269  }
270 
271  public function testGetMailsOfFolder(): void
272  {
273  $filter = ['status' => 'yes'];
274  $rowData = ['mail_id' => 8908];
275  $one = $rowData + [
276  'attachments' => [],
277  'tpl_ctx_params' => [],
278  'm_subject' => '',
279  'm_message' => '',
280  'rcp_to' => '',
281  'rcp_cc' => '',
282  'rcp_bcc' => '',
283  ];
284  $expected = [$one, $one];
285  $folderId = 89;
286  $userId = 901;
287  $instance = $this->create(234, $userId);
288  $mockStatement = $this->getMockBuilder(ilDBStatement::class)->getMock();
289  $this->mock_database->expects(self::never())->method('setLimit');
290  $this->mock_database->expects(self::exactly(3))->method('fetchAssoc')->with($mockStatement)->willReturnOnConsecutiveCalls($rowData, $rowData, null);
291  $this->mock_database->expects(self::once())->method('queryF')->willReturnCallback($this->queryCallback($mockStatement, ['integer', 'integer'], [$userId, $folderId]));
292 
293  $this->mock_database->expects(self::once())->method('quote')->with($filter['status'], 'text')->willReturn($filter['status']);
294 
295  $this->assertEquals($expected, $instance->getMailsOfFolder($folderId, $filter));
296  }
297 
298  public function testCountMailsOfFolder(): void
299  {
300  $userId = 46;
301  $folderId = 68;
302  $numRows = 89;
303  $instance = $this->create(345, $userId);
304  $mockStatement = $this->getMockBuilder(ilDBStatement::class)->getMock();
305  $this->mock_database->expects(self::once())->method('queryF')->willReturnCallback($this->queryCallback($mockStatement, ['integer', 'integer'], [$userId, $folderId]));
306  $this->mock_database->expects(self::once())->method('numRows')->with($mockStatement)->willReturn($numRows);
307 
308  $this->assertSame($numRows, $instance->countMailsOfFolder($folderId));
309  }
310 
311  public function testGetMail(): void
312  {
313  $mailId = 7890;
314  $instance = $this->createAndExpectDatabaseCall($mailId, []);
315  $instance->getMail($mailId);
316  }
317 
318  public function testMarkRead(): void
319  {
320  $mailIds = [1, 2, 3, 4, 5, 6];
321  $userId = 987;
322  $instance = $this->create(567, $userId);
323  $this->getMockBuilder(ilDBStatement::class)->getMock();
324  $this->mock_database->expects(self::once())->method('in')->with('mail_id', $mailIds, false, 'integer')->willReturn('');
325  $this->mock_database->expects(self::once())->method('manipulateF')->willReturnCallback($this->queryCallback(0, ['text', 'integer'], ['read', $userId]));
326 
327  $instance->markRead($mailIds);
328  }
329 
330  public function testMarkUnread(): void
331  {
332  $mailIds = [1, 2, 3, 4, 5, 6];
333  $userId = 987;
334  $instance = $this->create(567, $userId);
335  $this->getMockBuilder(ilDBStatement::class)->getMock();
336  $this->mock_database->expects(self::once())->method('in')->with('mail_id', $mailIds, false, 'integer')->willReturn('');
337  $this->mock_database->expects(self::once())->method('manipulateF')->willReturnCallback($this->queryCallback(0, ['text', 'integer'], ['unread', $userId]));
338 
339  $instance->markUnread($mailIds);
340  }
341 
342  public function testMoveMailsToFolder(): void
343  {
344  $mailIds = [1, 2, 3, 4, 5, 6];
345  $folderId = 890;
346  $userId = 987;
347  $instance = $this->create(567, $userId);
348  $this->mock_database->expects(self::once())->method('in')->with('mail_id', $mailIds, false, 'integer')->willReturn('');
349  $this->mock_database->expects(self::once())->method('manipulateF')->willReturnCallback($this->queryCallback(1, ['integer', 'integer', 'integer'], [$folderId, $userId, $userId]));
350 
351  $this->assertTrue($instance->moveMailsToFolder($mailIds, $folderId));
352  }
353 
354  public function testMoveMailsToFolderFalse(): void
355  {
356  $mailIds = [];
357  $instance = $this->create();
358  $this->mock_database->expects(self::never())->method('in');
359  $this->mock_database->expects(self::never())->method('manipulateF');
360 
361  $this->assertFalse($instance->moveMailsToFolder($mailIds, 892));
362  }
363 
364  public function testGetNewDraftId(): void
365  {
366  $nextId = 789;
367  $userId = 5678;
368  $folderId = 47;
369  $instance = $this->create(4749, $userId);
370 
371  $this->mock_database->expects(self::once())->method('nextId')->with('mail')->willReturn($nextId);
372  $this->mock_database->expects(self::once())->method('insert')->with('mail', [
373  'mail_id' => ['integer', $nextId],
374  'user_id' => ['integer', $userId],
375  'folder_id' => ['integer', $folderId],
376  'sender_id' => ['integer', $userId],
377  ]);
378 
379  $this->assertSame($nextId, $instance->getNewDraftId($folderId));
380  }
381 
382  public function testUpdateDraft(): void
383  {
384  $folderId = 7890;
385  $instance = $this->create();
386  $to = 'abc';
387  $cc = 'bcde';
388  $bcc = 'jkl';
389  $subject = 'jlh';
390  $message = 'some message';
391  $usePlaceholders = true;
392  $contextId = '87';
393  $params = [];
394  $draftId = 78;
395 
396  $this->mock_database->expects(self::once())->method('update')->with('mail', [
397  'folder_id' => ['integer', $folderId],
398  'attachments' => ['clob', serialize([])],
399  'send_time' => ['timestamp', date('Y-m-d H:i:s')],
400  'rcp_to' => ['clob', $to],
401  'rcp_cc' => ['clob', $cc],
402  'rcp_bcc' => ['clob', $bcc],
403  'm_status' => ['text', 'read'],
404  'm_subject' => ['text', $subject],
405  'm_message' => ['clob', $message],
406  'use_placeholders' => ['integer', (int) $usePlaceholders],
407  'tpl_ctx_id' => ['text', $contextId],
408  'tpl_ctx_params' => ['blob', json_encode($params, JSON_THROW_ON_ERROR)],
409  ], [
410  'mail_id' => ['integer', $draftId],
411  ]);
412 
413  $this->assertSame($draftId, $instance->updateDraft($folderId, [], $to, $cc, $bcc, $subject, $message, $draftId, $usePlaceholders, $contextId, $params));
414  }
415 
416  public function testPersistingToStage(): void
417  {
418  $userId = 897;
419  $attachments = [];
420  $rcpTo = 'jlh';
421  $rcpCc = 'jhkjh';
422  $rcpBcc = 'ououi';
423  $subject = 'hbansn';
424  $message = 'message';
425  $usePlaceholders = false;
426  $contextId = '9080';
427  $params = [];
428 
429  $instance = $this->create(789, $userId);
430 
431  $this->mock_database->expects(self::once())->method('replace')->with('mail_saved', [
432  'user_id' => ['integer', $userId],
433  ], [
434  'attachments' => ['clob', serialize($attachments)],
435  'rcp_to' => ['clob', $rcpTo],
436  'rcp_cc' => ['clob', $rcpCc],
437  'rcp_bcc' => ['clob', $rcpBcc],
438  'm_subject' => ['text', $subject],
439  'm_message' => ['clob', $message],
440  'use_placeholders' => ['integer', (int) $usePlaceholders],
441  'tpl_ctx_id' => ['text', $contextId],
442  'tpl_ctx_params' => ['blob', json_encode($params, JSON_THROW_ON_ERROR)],
443  ]);
444 
445  $mockStatement = $this->getMockBuilder(ilDBStatement::class)->disableOriginalConstructor()->getMock();
446  $this->mock_database->expects(self::once())->method('queryF')->willReturnCallback($this->queryCallback($mockStatement, ['integer'], [$userId]));
447  $this->mock_database->expects(self::once())->method('fetchAssoc')->with($mockStatement)->willReturn([
448  'rcp_to' => 'phpunit'
449  ]);
450 
451  $instance->persistToStage(
452  78_979_078,
453  $attachments,
454  $rcpTo,
455  $rcpCc,
456  $rcpBcc,
457  $subject,
458  $message,
459  $usePlaceholders,
460  $contextId,
461  $params,
462  );
463  }
464 
465  public function testRetrievalFromStage(): void
466  {
467  $userId = 789;
468  $instance = $this->create(67, $userId);
469  $mockStatement = $this->getMockBuilder(ilDBStatement::class)->disableOriginalConstructor()->getMock();
470  $this->mock_database->expects(self::once())->method('queryF')->willReturnCallback($this->queryCallback($mockStatement, ['integer'], [$userId]));
471  $this->mock_database->expects(self::once())->method('fetchAssoc')->with($mockStatement)->willReturn([
472  'rcp_to' => 'phpunit'
473  ]);
474 
475  $mail_data = $instance->retrieveFromStage();
476 
477  $this->assertIsArray($mail_data);
478  $this->assertEquals('phpunit', $mail_data['rcp_to']);
479  }
480 
481  public function testValidateRecipients($errors = []): void
482  {
483  $to = 'jkhk';
484  $cc = 'hjhjkl';
485  $bcc = 'jklhjk';
486 
487  $instance = $this->create();
488  $this->mock_log->expects(self::exactly(6))->method('debug')->withConsecutive(
489  ['Started parsing of recipient string: ' . $to],
490  ['Parsed addresses: hello'],
491  ['Started parsing of recipient string: ' . $cc],
492  ['Parsed addresses: hello'],
493  ['Started parsing of recipient string: ' . $bcc],
494  ['Parsed addresses: hello']
495  );
496 
497  $mockAddress = $this->getMockBuilder(ilMailAddress::class)->disableOriginalConstructor()->getMock();
498  $mockAddress->expects(self::exactly(3))->method('__toString')->willReturn('hello');
499  $mockParser = $this->getMockBuilder(ilMailRecipientParser::class)->disableOriginalConstructor()->getMock();
500  $mockParser->expects(self::exactly(3))->method('parse')->willReturn([$mockAddress]);
501  $this->mock_parser_factory->expects(self::exactly(3))->method('getParser')->withConsecutive([$to], [$cc], [$bcc])->willReturn($mockParser);
502 
503  $mockAddressType = $this->getMockBuilder(ilMailAddressType::class)->disableOriginalConstructor()->getMock();
504  $mockAddressType->expects(self::exactly(3))->method('validate')->willReturn(empty($errors));
505  $mockAddressType->expects(self::exactly(empty($errors) ? 0 : 3))->method('getErrors')->willReturn($errors);
506  $this->mock_address_type_factory->expects(self::exactly(3))->method('getByPrefix')->with($mockAddress)->willReturn($mockAddressType);
507 
508  $this->assertSame([], $instance->validateRecipients($to, $cc, $bcc));
509  }
510 
511  public function provideValidateRecipients(): array
512  {
513  return [
514  [[]],
515  [['some error']]
516  ];
517  }
518 
519  public function testGetIliasMailerName(): void
520  {
521  $expected = 'Phasellus lacus';
522  $settings = $this->getMockBuilder(ilSetting::class)->disableOriginalConstructor()->getMock();
523  $settings->method('get')->with('mail_system_sys_from_name')->willReturn($expected);
524  $this->setGlobalVariable('ilSetting', $settings);
525 
526 
527  $this->assertSame($expected, ilMail::_getIliasMailerName());
528  }
529 
530  public function testSaveAttachments(): void
531  {
532  $userId = 89;
533  $attachments = ['aaa', 'bb', 'cc', 'rrr'];
534  $instance = $this->create(789, $userId);
535 
536  $this->mock_database->expects(self::once())->method('update')->with(
537  'mail_saved',
538  [
539  'attachments' => ['clob', serialize($attachments)],
540  ],
541  [
542  'user_id' => ['integer', $userId],
543  ]
544  );
545 
546  $instance->saveAttachments($attachments);
547  }
548 
549  private function queryCallback($returnValue, array $expectedTypes, array $expectedValues): Closure
550  {
551  return function (string $query, array $types, array $values) use ($expectedTypes, $expectedValues, $returnValue) {
552  $this->assertEquals($expectedTypes, $types);
553  $this->assertEquals($expectedValues, $values);
554 
555  return $returnValue;
556  };
557  }
558 
559  private function createAndExpectDatabaseCall(int $someMailId, array $rowData): ilMail
560  {
561  $userId = 900;
562  $instance = $this->create(234, $userId);
563  $mockStatement = $this->getMockBuilder(ilDBStatement::class)->getMock();
564  $this->mock_database->expects(self::once())->method('fetchAssoc')->with($mockStatement)->willReturn($rowData);
565  $this->mock_database->expects(self::once())->method('queryF')->willReturnCallback($this->queryCallback($mockStatement, ['integer', 'integer'], [$userId, $someMailId]));
566 
567  return $instance;
568  }
569 
570  private function create(int $refId = 234, int $userId = 123): ilMail
571  {
572  return new ilMail(
573  $userId,
574  ($this->mock_address_type_factory = $this->getMockBuilder(ilMailAddressTypeFactory::class)->disableOriginalConstructor()->getMock()),
575  ($this->mock_parser_factory = $this->getMockBuilder(ilMailRfc822AddressParserFactory::class)->disableOriginalConstructor()->getMock()),
576  $this->getMockBuilder(ilAppEventHandler::class)->disableOriginalConstructor()->getMock(),
577  ($this->mock_log = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock()),
578  ($this->mock_database = $this->getMockBuilder(ilDBInterface::class)->disableOriginalConstructor()->getMock()),
579  ($this->mock_language = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock()),
580  $this->getMockBuilder(ilFileDataMail::class)->disableOriginalConstructor()->getMock(),
581  $this->getMockBuilder(ilMailOptions::class)->disableOriginalConstructor()->getMock(),
582  $this->getMockBuilder(ilMailbox::class)->disableOriginalConstructor()->getMock(),
583  $this->getMockBuilder(ilMailMimeSenderFactory::class)->disableOriginalConstructor()->getMock(),
584  static function (string $login): int {
585  return 780;
586  },
587  $this->createMock(AutoresponderService::class),
588  0,
589  $refId,
590  $this->getMockBuilder(ilObjUser::class)->disableOriginalConstructor()->getMock(),
591  $this->getMockBuilder(ilMailTemplatePlaceholderResolver::class)->disableOriginalConstructor()->getMock()
592  );
593  }
594 }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
static addUserToCache(int $usrId, ilObjUser $user)
testMoveMailsToFolder()
Definition: ilMailTest.php:342
testValidateRecipients($errors=[])
Definition: ilMailTest.php:481
testGetNewDraftId()
Definition: ilMailTest.php:364
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
MockObject &ilDBInterface $mock_database
Definition: ilMailTest.php:35
testPersistingToStage()
Definition: ilMailTest.php:416
MockObject &ilMailRfc822AddressParserFactory $mock_parser_factory
Definition: ilMailTest.php:38
testExternalMailDeliveryToLocalRecipientsWorksAsExpected()
Definition: ilMailTest.php:44
static _getIliasMailerName()
$refId
Definition: xapitoken.php:58
Class ilMailMimeTest.
Definition: ilMailTest.php:33
MockObject &ilLanguage $mock_language
Definition: ilMailTest.php:39
static setDefaultTransport(?ilMailMimeTransport $transport)
MockObject &ilLogger $mock_log
Definition: ilMailTest.php:37
testRetrievalFromStage()
Definition: ilMailTest.php:465
static getDefaultTransport()
Class ilMailBaseTest.
Interface ilMailAddressType.
testGetIliasMailerName()
Definition: ilMailTest.php:519
Class ilMailRfc822AddressParserFactory.
final const INCOMING_EMAIL
testGetPreviousMail(array $rowData)
provideGetPreviousMail
Definition: ilMailTest.php:232
setGlobalVariable(string $name, $value)
__construct(VocabulariesInterface $vocabularies)
$lng
create(int $refId=234, int $userId=123)
Definition: ilMailTest.php:570
testMoveMailsToFolderFalse()
Definition: ilMailTest.php:354
createAndExpectDatabaseCall(int $someMailId, array $rowData)
Definition: ilMailTest.php:559
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Ok.php:16
queryCallback($returnValue, array $expectedTypes, array $expectedValues)
Definition: ilMailTest.php:549
Class ilMailTemplatePlaceholderResolver.
testGetMailObjectReferenceId()
Definition: ilMailTest.php:211
testCountMailsOfFolder()
Definition: ilMailTest.php:298
testGetMailsOfFolder()
Definition: ilMailTest.php:271
provideValidateRecipients()
Definition: ilMailTest.php:511
testFormatNamesForOutput()
Definition: ilMailTest.php:219
MockObject &ilMailAddressTypeFactory $mock_address_type_factory
Definition: ilMailTest.php:36
provideGetPreviousMail()
Definition: ilMailTest.php:240
testSaveAttachments()
Definition: ilMailTest.php:530
$message
Definition: xapiexit.php:32
Class ilMailAddressTypeFactory.
Class ilMailAddress.