Línea 40... |
Línea 40... |
40 |
/**
|
40 |
/**
|
41 |
* Tests set up
|
41 |
* Tests set up
|
42 |
*/
|
42 |
*/
|
43 |
protected function setUp(): void {
|
43 |
protected function setUp(): void {
|
44 |
global $CFG;
|
44 |
global $CFG;
|
- |
|
45 |
parent::setUp();
|
Línea 45... |
Línea 46... |
45 |
|
46 |
|
46 |
// We must clear the subscription caches. This has to be done both before each test, and after in case of other
|
47 |
// We must clear the subscription caches. This has to be done both before each test, and after in case of other
|
47 |
// tests using these functions.
|
48 |
// tests using these functions.
|
Línea 52... |
Línea 53... |
52 |
|
53 |
|
53 |
public function tearDown(): void {
|
54 |
public function tearDown(): void {
|
54 |
// We must clear the subscription caches. This has to be done both before each test, and after in case of other
|
55 |
// We must clear the subscription caches. This has to be done both before each test, and after in case of other
|
55 |
// tests using these functions.
|
56 |
// tests using these functions.
|
- |
|
57 |
\mod_forum\subscriptions::reset_forum_cache();
|
56 |
\mod_forum\subscriptions::reset_forum_cache();
|
58 |
parent::tearDown();
|
Línea 57... |
Línea 59... |
57 |
}
|
59 |
}
|
58 |
|
60 |
|
59 |
/**
|
61 |
/**
|
Línea 490... |
Línea 492... |
490 |
'parentid' => $discussion1reply2->parent,
|
492 |
'parentid' => $discussion1reply2->parent,
|
491 |
'hasparent' => true,
|
493 |
'hasparent' => true,
|
492 |
'timecreated' => $discussion1reply2->created,
|
494 |
'timecreated' => $discussion1reply2->created,
|
493 |
'timemodified' => $discussion1reply2->modified,
|
495 |
'timemodified' => $discussion1reply2->modified,
|
494 |
'subject' => $discussion1reply2->subject,
|
496 |
'subject' => $discussion1reply2->subject,
|
495 |
'replysubject' => get_string('re', 'mod_forum') . " {$discussion1reply2->subject}",
|
497 |
'replysubject' => $discussion1reply2->subject,
|
496 |
'message' => $message,
|
498 |
'message' => $message,
|
497 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
499 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
498 |
'unread' => null,
|
500 |
'unread' => null,
|
499 |
'isdeleted' => false,
|
501 |
'isdeleted' => false,
|
500 |
'isprivatereply' => false,
|
502 |
'isprivatereply' => false,
|
Línea 549... |
Línea 551... |
549 |
'parentid' => $discussion1reply1->parent,
|
551 |
'parentid' => $discussion1reply1->parent,
|
550 |
'hasparent' => true,
|
552 |
'hasparent' => true,
|
551 |
'timecreated' => $discussion1reply1->created,
|
553 |
'timecreated' => $discussion1reply1->created,
|
552 |
'timemodified' => $discussion1reply1->modified,
|
554 |
'timemodified' => $discussion1reply1->modified,
|
553 |
'subject' => $discussion1reply1->subject,
|
555 |
'subject' => $discussion1reply1->subject,
|
554 |
'replysubject' => get_string('re', 'mod_forum') . " {$discussion1reply1->subject}",
|
556 |
'replysubject' => $discussion1reply1->subject,
|
555 |
'message' => $message,
|
557 |
'message' => $message,
|
556 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
558 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
557 |
'unread' => null,
|
559 |
'unread' => null,
|
558 |
'isdeleted' => false,
|
560 |
'isdeleted' => false,
|
559 |
'isprivatereply' => false,
|
561 |
'isprivatereply' => false,
|
Línea 2468... |
Línea 2470... |
2468 |
'parentid' => $discussion1reply1->parent,
|
2470 |
'parentid' => $discussion1reply1->parent,
|
2469 |
'hasparent' => true,
|
2471 |
'hasparent' => true,
|
2470 |
'timecreated' => $discussion1reply1->created,
|
2472 |
'timecreated' => $discussion1reply1->created,
|
2471 |
'timemodified' => $discussion1reply1->modified,
|
2473 |
'timemodified' => $discussion1reply1->modified,
|
2472 |
'subject' => $discussion1reply1->subject,
|
2474 |
'subject' => $discussion1reply1->subject,
|
2473 |
'replysubject' => get_string('re', 'mod_forum') . " {$discussion1reply1->subject}",
|
2475 |
'replysubject' => $discussion1reply1->subject,
|
2474 |
'message' => file_rewrite_pluginfile_urls($discussion1reply1->message, 'pluginfile.php',
|
2476 |
'message' => file_rewrite_pluginfile_urls($discussion1reply1->message, 'pluginfile.php',
|
2475 |
$forum1context->id, 'mod_forum', 'post', $discussion1reply1->id),
|
2477 |
$forum1context->id, 'mod_forum', 'post', $discussion1reply1->id),
|
2476 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
2478 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
2477 |
'unread' => null,
|
2479 |
'unread' => null,
|
2478 |
'isdeleted' => false,
|
2480 |
'isdeleted' => false,
|
Línea 2534... |
Línea 2536... |
2534 |
'parentid' => null,
|
2536 |
'parentid' => null,
|
2535 |
'hasparent' => false,
|
2537 |
'hasparent' => false,
|
2536 |
'timecreated' => $discussion1firstpostobject->created,
|
2538 |
'timecreated' => $discussion1firstpostobject->created,
|
2537 |
'timemodified' => $discussion1firstpostobject->modified,
|
2539 |
'timemodified' => $discussion1firstpostobject->modified,
|
2538 |
'subject' => $discussion1firstpostobject->subject,
|
2540 |
'subject' => $discussion1firstpostobject->subject,
|
2539 |
'replysubject' => get_string('re', 'mod_forum') . " {$discussion1firstpostobject->subject}",
|
2541 |
'replysubject' => $discussion1firstpostobject->subject,
|
2540 |
'message' => file_rewrite_pluginfile_urls($discussion1firstpostobject->message, 'pluginfile.php',
|
2542 |
'message' => file_rewrite_pluginfile_urls($discussion1firstpostobject->message, 'pluginfile.php',
|
2541 |
$forum1context->id, 'mod_forum', 'post', $discussion1firstpostobject->id),
|
2543 |
$forum1context->id, 'mod_forum', 'post', $discussion1firstpostobject->id),
|
2542 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
2544 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
2543 |
'unread' => null,
|
2545 |
'unread' => null,
|
2544 |
'isdeleted' => false,
|
2546 |
'isdeleted' => false,
|
Línea 2611... |
Línea 2613... |
2611 |
'parentid' => $discussion2reply1->parent,
|
2613 |
'parentid' => $discussion2reply1->parent,
|
2612 |
'hasparent' => true,
|
2614 |
'hasparent' => true,
|
2613 |
'timecreated' => $discussion2reply1->created,
|
2615 |
'timecreated' => $discussion2reply1->created,
|
2614 |
'timemodified' => $discussion2reply1->modified,
|
2616 |
'timemodified' => $discussion2reply1->modified,
|
2615 |
'subject' => $discussion2reply1->subject,
|
2617 |
'subject' => $discussion2reply1->subject,
|
2616 |
'replysubject' => get_string('re', 'mod_forum') . " {$discussion2reply1->subject}",
|
2618 |
'replysubject' => $discussion2reply1->subject,
|
2617 |
'message' => file_rewrite_pluginfile_urls($discussion2reply1->message, 'pluginfile.php',
|
2619 |
'message' => file_rewrite_pluginfile_urls($discussion2reply1->message, 'pluginfile.php',
|
2618 |
$forum1context->id, 'mod_forum', 'post', $discussion2reply1->id),
|
2620 |
$forum1context->id, 'mod_forum', 'post', $discussion2reply1->id),
|
2619 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
2621 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
2620 |
'unread' => null,
|
2622 |
'unread' => null,
|
2621 |
'isdeleted' => false,
|
2623 |
'isdeleted' => false,
|
Línea 2677... |
Línea 2679... |
2677 |
'parentid' => null,
|
2679 |
'parentid' => null,
|
2678 |
'hasparent' => false,
|
2680 |
'hasparent' => false,
|
2679 |
'timecreated' => $discussion2firstpostobject->created,
|
2681 |
'timecreated' => $discussion2firstpostobject->created,
|
2680 |
'timemodified' => $discussion2firstpostobject->modified,
|
2682 |
'timemodified' => $discussion2firstpostobject->modified,
|
2681 |
'subject' => $discussion2firstpostobject->subject,
|
2683 |
'subject' => $discussion2firstpostobject->subject,
|
2682 |
'replysubject' => get_string('re', 'mod_forum') . " {$discussion2firstpostobject->subject}",
|
2684 |
'replysubject' => $discussion2firstpostobject->subject,
|
2683 |
'message' => file_rewrite_pluginfile_urls($discussion2firstpostobject->message, 'pluginfile.php',
|
2685 |
'message' => file_rewrite_pluginfile_urls($discussion2firstpostobject->message, 'pluginfile.php',
|
2684 |
$forum1context->id, 'mod_forum', 'post', $discussion2firstpostobject->id),
|
2686 |
$forum1context->id, 'mod_forum', 'post', $discussion2firstpostobject->id),
|
2685 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
2687 |
'messageformat' => 1, // This value is usually changed by \core_external\util::format_text() function.
|
2686 |
'unread' => null,
|
2688 |
'unread' => null,
|
2687 |
'isdeleted' => false,
|
2689 |
'isdeleted' => false,
|