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