Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
communication_matrix

Namespaces

namespace  communication_matrix
  
 
namespace  communication_matrix\local
  
 
namespace  communication_matrix\local\spec
  
 
namespace  communication_matrix\local\spec\features\matrix
  
 
namespace  communication_matrix\local\spec\features\synapse
  
 
namespace  communication_matrix\privacy
  
 

Classes

class  behat_communication_matrix
 
class  communication_matrix\communication_feature
 
class  communication_matrix\local\command
 
class  communication_matrix\local\spec\v1p1
 
class  communication_matrix\local\spec\v1p2
 
class  communication_matrix\local\spec\v1p3
 
class  communication_matrix\local\spec\v1p4
 
class  communication_matrix\local\spec\v1p5
 
class  communication_matrix\local\spec\v1p6
 
class  communication_matrix\local\spec\v1p7
 
class  communication_matrix\matrix_client
 
class  communication_matrix\matrix_constants
 
class  communication_matrix\matrix_room
 
class  communication_matrix\matrix_user_manager
 
class  communication_matrix\privacy\provider
 

Functions

 communication_matrix::backoffice_create_users_and_rooms (array $users=[], array $rooms=[],)
 A backoffice method to create users and rooms on our mock server.
 
 communication_matrix::backoffice_get_all_rooms ()
 Fetch all rooms from the back office.
 
 communication_matrix::backoffice_get_all_users ()
 A backoffice call to get all registered users from our mock server.
 
 communication_matrix::backoffice_get_room ()
 Return the first room from the server.
 
 communication_matrix::create_matrix_room (?string $component='core_course', ?string $itemtype='example', ?int $itemid=1, ?string $roomname=null, ?string $roomtopic=null, ?\stored_file $roomavatar=null, array $members=[], ?context $context=null,)
 Helper to create a room.
 
 communication_matrix::get_backoffice_uri (string $endpoint)
 Get the URI of a backoffice endpoint on the mock server.
 
 communication_matrix::get_matrix_access_token ()
 Get the matrix access token.
 
 communication_matrix::get_matrix_room_data (string $roomid)
 Get matrix room data from matrix server.
 
 communication_matrix::get_matrix_server_url ()
 Get the mock server url.
 
 communication_matrix::get_matrix_user_data (string $roomid, string $matrixuserid)
 Get matrix user data from matrix server.
 
 communication_matrix::initialise_mock_configs ()
 Initialize the mock configs in settings.
 
 communication_matrix::initialise_mock_server ()
 This test requires mock server to be present.
 
 communication_matrix::request (array $jsonarray=[], array $headers=[])
 The http request for the api call.
 
 communication_matrix::reset_mock ()
 Reset the mock server.
 
 xmldb_communication_matrix_upgrade ($oldversion)
 Upgrade procedures for the matrix plugin.
 

Variables

 $capabilities
 
 $definitions
 
string string communication_matrix::$matrixhomeserverurl
 $matrixhomeserverurl The server url of matrix synapse server
 
 $plugin = 2024041600
 
$plugin component = 'communication_matrix'
 
trait communication_matrix::matrix_test_helper_trait
 
$plugin maturity = MATURITY_ALPHA
 
$plugin version = 2024042200
 

Detailed Description

Function Documentation

◆ backoffice_create_users_and_rooms()

communication_matrix\backoffice_create_users_and_rooms ( array $users = [],
array $rooms = [] )

A backoffice method to create users and rooms on our mock server.

Parameters
array$users
array$rooms

◆ backoffice_get_all_rooms()

communication_matrix\backoffice_get_all_rooms ( )

Fetch all rooms from the back office.

Return values
array

◆ backoffice_get_all_users()

communication_matrix\backoffice_get_all_users ( )

A backoffice call to get all registered users from our mock server.

Return values
array

◆ backoffice_get_room()

communication_matrix\backoffice_get_room ( )

Return the first room from the server.

In most cases there is only one room.

Return values
stdClass

◆ create_matrix_room()

communication_matrix\create_matrix_room ( ?string $component = 'core_course',
?string $itemtype = 'example',
?int $itemid = 1,
?string $roomname = null,
?string $roomtopic = null,
?\stored_file $roomavatar = null,
array $members = [],
?context $context = null )
protected

Helper to create a room.

Parameters
null | string$component
null | string$itemtype
null | int$itemid
null | string$roomname
null | string$roomtopic
null | stored_file$roomavatar
array$members
Return values
api

◆ get_backoffice_uri()

communication_matrix\get_backoffice_uri ( string $endpoint)
protected

Get the URI of a backoffice endpoint on the mock server.

Parameters
string$endpoint
Return values
string

◆ get_matrix_access_token()

communication_matrix\get_matrix_access_token ( )

Get the matrix access token.

Return values
string

◆ get_matrix_room_data()

communication_matrix\get_matrix_room_data ( string $roomid)

Get matrix room data from matrix server.

Parameters
string$roomidThe id of the room
Return values
stdClass

◆ get_matrix_server_url()

communication_matrix\get_matrix_server_url ( )

Get the mock server url.

Return values
string

◆ get_matrix_user_data()

communication_matrix\get_matrix_user_data ( string $roomid,
string $matrixuserid )

Get matrix user data from matrix server.

Parameters
string$roomidThe id of the room
string$matrixuseridThe id of the user
Return values
stdClass

◆ initialise_mock_configs()

communication_matrix\initialise_mock_configs ( )
protected

Initialize the mock configs in settings.

Return values
void

◆ initialise_mock_server()

communication_matrix\initialise_mock_server ( )
protected

This test requires mock server to be present.

Return values
void

◆ request()

communication_matrix\request ( array $jsonarray = [],
array $headers = [] )

The http request for the api call.

Parameters
array$jsonarrayThe array of json
array$headersThe array of headers
Return values
core\http_client

◆ reset_mock()

communication_matrix\reset_mock ( )

Reset the mock server.

Return values
void

◆ xmldb_communication_matrix_upgrade()

xmldb_communication_matrix_upgrade ( $oldversion)

Upgrade procedures for the matrix plugin.

Return values
bool

Variable Documentation

◆ $capabilities

$capabilities
Initial value:
= [
'communication/matrix:moderator' => [
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
],
],
]
const CONTEXT_COURSE
Course context level - one instances for each course.
Definition accesslib.php:128
const CAP_ALLOW
Allow permission, overrides CAP_PREVENT defined in parent contexts.
Definition accesslib.php:115

◆ $definitions

$definitions
Initial value:
= [
'serverversions' => [
'mode' => cache_store::MODE_APPLICATION,
'simplekeys' => true,
'simpledata' => true,
'staticacceleration' => true,
'staticaccelerationsize' => 1,
'canuselocalstore' => true,
'ttl' => 60 * 60 * 24,
],
]

◆ matrix_test_helper_trait

trait communication_matrix\matrix_test_helper_trait
Initial value:
{
protected string string $accesstoken