The helper class providing util methods for testing.
More...
|
static | send_fake_message_to_conversation (\stdClass $userfrom, int $convid, string $message='Hello world!', int $time=null) |
| Sends a message to a conversation.
|
|
static | send_fake_read_notification (\stdClass $userfrom, stdClass $userto, string $message='Hello world!', int $timecreated=0, int $timeread=0) |
| Send a fake read notification.
|
|
static | send_fake_unread_notification (\stdClass $userfrom, stdClass $userto, string $message='Hello world!', int $timecreated=0) |
| Send a fake unread notification.
|
|
The helper class providing util methods for testing.
- Copyright
- 2018 Jake Dallimore markn.nosp@m.@moo.nosp@m.dle.c.nosp@m.om
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ send_fake_message_to_conversation()
static core_message\tests\helper::send_fake_message_to_conversation |
( |
\stdClass | $userfrom, |
|
|
int | $convid, |
|
|
string | $message = 'Hello world!', |
|
|
int | $time = null ) |
|
static |
Sends a message to a conversation.
- Parameters
-
stdClass | $userfrom | user object of the one sending the message. |
int | $convid | id of the conversation in which we'll send the message. |
string | $message | message to send. |
int | $time | the time the message was sent. |
- Return values
-
int | the id of the message which was sent. |
- Exceptions
-
◆ send_fake_read_notification()
static core_message\tests\helper::send_fake_read_notification |
( |
\stdClass | $userfrom, |
|
|
stdClass | $userto, |
|
|
string | $message = 'Hello world!', |
|
|
int | $timecreated = 0, |
|
|
int | $timeread = 0 ) |
|
static |
Send a fake read notification.
message_send() does not support transaction, this function will simulate a message sent from a user to another. We should stop using it once message_send() will support transactions. This is not clean at all, this is just used to add rows to the table.
- Parameters
-
stdClass | $userfrom | user object of the one sending the message. |
stdClass | $userto | user object of the one receiving the message. |
string | $message | message to send. |
int | $timecreated | time the message was created. |
int | $timeread | the the message was read |
- Return values
-
◆ send_fake_unread_notification()
static core_message\tests\helper::send_fake_unread_notification |
( |
\stdClass | $userfrom, |
|
|
stdClass | $userto, |
|
|
string | $message = 'Hello world!', |
|
|
int | $timecreated = 0 ) |
|
static |
Send a fake unread notification.
message_send() does not support transaction, this function will simulate a message sent from a user to another. We should stop using it once message_send() will support transactions. This is not clean at all, this is just used to add rows to the table.
- Parameters
-
stdClass | $userfrom | user object of the one sending the message. |
stdClass | $userto | user object of the one receiving the message. |
string | $message | message to send. |
int | $timecreated | time the message was created. |
- Return values
-
The documentation for this class was generated from the following file:
- message/classes/tests/helper.php