| Línea 35... |
Línea 35... |
| 35 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
35 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 36 |
* @author Jesus Federico (jesus [at] blindsidenetworks [dt] com)
|
36 |
* @author Jesus Federico (jesus [at] blindsidenetworks [dt] com)
|
| 37 |
* @covers \mod_bigbluebuttonbn\meeting
|
37 |
* @covers \mod_bigbluebuttonbn\meeting
|
| 38 |
* @coversDefaultClass \mod_bigbluebuttonbn\meeting
|
38 |
* @coversDefaultClass \mod_bigbluebuttonbn\meeting
|
| 39 |
*/
|
39 |
*/
|
| 40 |
class meeting_test extends \advanced_testcase {
|
40 |
final class meeting_test extends \advanced_testcase {
|
| 41 |
use testcase_helper_trait;
|
41 |
use testcase_helper_trait;
|
| Línea 42... |
Línea 42... |
| 42 |
|
42 |
|
| 43 |
/**
|
43 |
/**
|
| 44 |
* Setup Test
|
44 |
* Setup Test
|
| Línea 55... |
Línea 55... |
| 55 |
/**
|
55 |
/**
|
| 56 |
* Get a list of possible test (dataprovider)
|
56 |
* Get a list of possible test (dataprovider)
|
| 57 |
*
|
57 |
*
|
| 58 |
* @return array[]
|
58 |
* @return array[]
|
| 59 |
*/
|
59 |
*/
|
| 60 |
public function get_instance_types_meeting_info(): array {
|
60 |
public static function get_instance_types_meeting_info(): array {
|
| 61 |
return [
|
61 |
return [
|
| 62 |
'Instance Type ALL - No Group' => [
|
62 |
'Instance Type ALL - No Group' => [
|
| 63 |
'type' => instance::TYPE_ALL,
|
63 |
'type' => instance::TYPE_ALL,
|
| 64 |
'groupname' => null,
|
64 |
'groupname' => null,
|
| 65 |
'groupmode' => NOGROUPS,
|
65 |
'groupmode' => NOGROUPS,
|
| Línea 118... |
Línea 118... |
| 118 |
* @param string|null $groupname
|
118 |
* @param string|null $groupname
|
| 119 |
* @covers ::create_meeting
|
119 |
* @covers ::create_meeting
|
| 120 |
* @covers ::create_meeting_data
|
120 |
* @covers ::create_meeting_data
|
| 121 |
* @covers ::create_meeting_metadata
|
121 |
* @covers ::create_meeting_metadata
|
| 122 |
*/
|
122 |
*/
|
| 123 |
public function test_create_meeting(int $type, ?string $groupname): void {
|
123 |
public function test_create_meeting(int $type, ?string $groupname, $groupmode, $canjoin): void {
|
| 124 |
$this->resetAfterTest();
|
124 |
$this->resetAfterTest();
|
| 125 |
[$meeting, $useringroup, $usernotingroup, $groupid, $activity] =
|
125 |
[$meeting, $useringroup, $usernotingroup, $groupid, $activity] =
|
| 126 |
$this->prepare_meeting($type, $groupname, SEPARATEGROUPS, false);
|
126 |
$this->prepare_meeting($type, $groupname, SEPARATEGROUPS, false);
|
| 127 |
$meeting->create_meeting();
|
127 |
$meeting->create_meeting();
|
| 128 |
$meetinginfo = $meeting->get_meeting_info();
|
128 |
$meetinginfo = $meeting->get_meeting_info();
|
| Línea 140... |
Línea 140... |
| 140 |
* @param string|null $groupname
|
140 |
* @param string|null $groupname
|
| 141 |
* @dataProvider get_instance_types_meeting_info
|
141 |
* @dataProvider get_instance_types_meeting_info
|
| 142 |
* @covers ::get_meeting_info
|
142 |
* @covers ::get_meeting_info
|
| 143 |
* @covers ::do_get_meeting_info
|
143 |
* @covers ::do_get_meeting_info
|
| 144 |
*/
|
144 |
*/
|
| 145 |
public function test_get_meeting_info(int $type, ?string $groupname): void {
|
145 |
public function test_get_meeting_info(int $type, ?string $groupname, $groupmode, $canjoin): void {
|
| 146 |
$this->resetAfterTest();
|
146 |
$this->resetAfterTest();
|
| 147 |
[$meeting, $useringroup, $usernotingroup, $groupid, $activity] = $this->prepare_meeting($type, $groupname);
|
147 |
[$meeting, $useringroup, $usernotingroup, $groupid, $activity] = $this->prepare_meeting($type, $groupname);
|
| 148 |
$meetinginfo = $meeting->get_meeting_info();
|
148 |
$meetinginfo = $meeting->get_meeting_info();
|
| 149 |
$this->assertNotNull($meetinginfo);
|
149 |
$this->assertNotNull($meetinginfo);
|
| 150 |
$this->assertEquals($activity->id, $meetinginfo->bigbluebuttonbnid);
|
150 |
$this->assertEquals($activity->id, $meetinginfo->bigbluebuttonbnid);
|
| Línea 415... |
Línea 415... |
| 415 |
/**
|
415 |
/**
|
| 416 |
* Get a list of possible test (dataprovider)
|
416 |
* Get a list of possible test (dataprovider)
|
| 417 |
*
|
417 |
*
|
| 418 |
* @return array[]
|
418 |
* @return array[]
|
| 419 |
*/
|
419 |
*/
|
| 420 |
public function get_data_can_join_with_dates(): array {
|
420 |
public static function get_data_can_join_with_dates(): array {
|
| 421 |
return [
|
421 |
return [
|
| 422 |
'Instance Type ALL - No Group - Closed in past' => [
|
422 |
'Instance Type ALL - No Group - Closed in past' => [
|
| 423 |
'type' => instance::TYPE_ALL,
|
423 |
'type' => instance::TYPE_ALL,
|
| 424 |
'groupname' => null,
|
424 |
'groupname' => null,
|
| 425 |
'groupmode' => NOGROUPS,
|
425 |
'groupmode' => NOGROUPS,
|