| 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) {
|
123 |
public function test_create_meeting(int $type, ?string $groupname): 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) {
|
145 |
public function test_get_meeting_info(int $type, ?string $groupname): 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 176... |
Línea 176... |
| 176 |
* @param int $groupmode
|
176 |
* @param int $groupmode
|
| 177 |
* @param array $canjoin
|
177 |
* @param array $canjoin
|
| 178 |
* @dataProvider get_instance_types_meeting_info
|
178 |
* @dataProvider get_instance_types_meeting_info
|
| 179 |
* @covers ::can_join
|
179 |
* @covers ::can_join
|
| 180 |
*/
|
180 |
*/
|
| 181 |
public function test_can_join(int $type, ?string $groupname, int $groupmode, array $canjoin) {
|
181 |
public function test_can_join(int $type, ?string $groupname, int $groupmode, array $canjoin): void {
|
| 182 |
$this->resetAfterTest();
|
182 |
$this->resetAfterTest();
|
| 183 |
[$meeting, $useringroup, $usernotingroup, $groupid, $activity] = $this->prepare_meeting($type, $groupname, $groupmode);
|
183 |
[$meeting, $useringroup, $usernotingroup, $groupid, $activity] = $this->prepare_meeting($type, $groupname, $groupmode);
|
| 184 |
$this->setUser($useringroup);
|
184 |
$this->setUser($useringroup);
|
| 185 |
$meeting->update_cache();
|
185 |
$meeting->update_cache();
|
| 186 |
$this->assertEquals($canjoin['useringroup'], $meeting->can_join());
|
186 |
$this->assertEquals($canjoin['useringroup'], $meeting->can_join());
|
| Línea 204... |
Línea 204... |
| 204 |
* @param array $canjoin
|
204 |
* @param array $canjoin
|
| 205 |
* @param array $dates
|
205 |
* @param array $dates
|
| 206 |
* @dataProvider get_data_can_join_with_dates
|
206 |
* @dataProvider get_data_can_join_with_dates
|
| 207 |
* @covers ::can_join
|
207 |
* @covers ::can_join
|
| 208 |
*/
|
208 |
*/
|
| 209 |
public function test_can_join_with_dates(int $type, ?string $groupname, int $groupmode, array $canjoin, array $dates) {
|
209 |
public function test_can_join_with_dates(int $type, ?string $groupname, int $groupmode, array $canjoin, array $dates): void {
|
| 210 |
// Apply the data provider relative values to now.
|
210 |
// Apply the data provider relative values to now.
|
| 211 |
array_walk($dates, function(&$val) {
|
211 |
array_walk($dates, function(&$val) {
|
| 212 |
$val = time() + $val;
|
212 |
$val = time() + $val;
|
| 213 |
});
|
213 |
});
|
| 214 |
$this->resetAfterTest();
|
214 |
$this->resetAfterTest();
|
| Línea 233... |
Línea 233... |
| 233 |
* Test can join is working if the "Wait for moderator to join" setting is set and a moderator has not yet joined.
|
233 |
* Test can join is working if the "Wait for moderator to join" setting is set and a moderator has not yet joined.
|
| 234 |
*
|
234 |
*
|
| 235 |
* @covers ::join
|
235 |
* @covers ::join
|
| 236 |
* @covers ::join_meeting
|
236 |
* @covers ::join_meeting
|
| 237 |
*/
|
237 |
*/
|
| 238 |
public function test_join_wait_for_moderator_not_joined() {
|
238 |
public function test_join_wait_for_moderator_not_joined(): void {
|
| 239 |
$this->resetAfterTest();
|
239 |
$this->resetAfterTest();
|
| Línea 240... |
Línea 240... |
| 240 |
|
240 |
|
| 241 |
$this->setAdminUser();
|
241 |
$this->setAdminUser();
|
| 242 |
$bbbgenerator = $this->getDataGenerator()->get_plugin_generator('mod_bigbluebuttonbn');
|
242 |
$bbbgenerator = $this->getDataGenerator()->get_plugin_generator('mod_bigbluebuttonbn');
|
| Línea 263... |
Línea 263... |
| 263 |
* Test can join is working if the "Wait for moderator to join" setting is set and a moderator has already joined.
|
263 |
* Test can join is working if the "Wait for moderator to join" setting is set and a moderator has already joined.
|
| 264 |
*
|
264 |
*
|
| 265 |
* @covers ::join
|
265 |
* @covers ::join
|
| 266 |
* @covers ::join_meeting
|
266 |
* @covers ::join_meeting
|
| 267 |
*/
|
267 |
*/
|
| 268 |
public function test_join_wait_for_moderator_is_joined() {
|
268 |
public function test_join_wait_for_moderator_is_joined(): void {
|
| 269 |
$this->resetAfterTest();
|
269 |
$this->resetAfterTest();
|
| Línea 270... |
Línea 270... |
| 270 |
|
270 |
|
| 271 |
$this->setAdminUser();
|
271 |
$this->setAdminUser();
|
| 272 |
$bbbgenerator = $this->getDataGenerator()->get_plugin_generator('mod_bigbluebuttonbn');
|
272 |
$bbbgenerator = $this->getDataGenerator()->get_plugin_generator('mod_bigbluebuttonbn');
|
| Línea 305... |
Línea 305... |
| 305 |
* Test can join is working if the "user limit" setting is set and reached.
|
305 |
* Test can join is working if the "user limit" setting is set and reached.
|
| 306 |
*
|
306 |
*
|
| 307 |
* @covers ::join
|
307 |
* @covers ::join
|
| 308 |
* @covers ::join_meeting
|
308 |
* @covers ::join_meeting
|
| 309 |
*/
|
309 |
*/
|
| 310 |
public function test_join_user_limit_reached() {
|
310 |
public function test_join_user_limit_reached(): void {
|
| 311 |
$this->resetAfterTest();
|
311 |
$this->resetAfterTest();
|
| 312 |
set_config('bigbluebuttonbn_userlimit_editable', true);
|
312 |
set_config('bigbluebuttonbn_userlimit_editable', true);
|
| 313 |
$this->setAdminUser();
|
313 |
$this->setAdminUser();
|
| 314 |
$bbbgenerator = $this->getDataGenerator()->get_plugin_generator('mod_bigbluebuttonbn');
|
314 |
$bbbgenerator = $this->getDataGenerator()->get_plugin_generator('mod_bigbluebuttonbn');
|
| 315 |
$moderator = $this->getDataGenerator()->create_and_enrol($this->get_course(), 'editingteacher');
|
315 |
$moderator = $this->getDataGenerator()->create_and_enrol($this->get_course(), 'editingteacher');
|
| Línea 352... |
Línea 352... |
| 352 |
/**
|
352 |
/**
|
| 353 |
* Test that attendees returns the right list of attendees
|
353 |
* Test that attendees returns the right list of attendees
|
| 354 |
*
|
354 |
*
|
| 355 |
* @covers ::get_attendees
|
355 |
* @covers ::get_attendees
|
| 356 |
*/
|
356 |
*/
|
| 357 |
public function test_get_attendees() {
|
357 |
public function test_get_attendees(): void {
|
| 358 |
$this->resetAfterTest();
|
358 |
$this->resetAfterTest();
|
| 359 |
[$meeting, $useringroup, $usernotingroup, $groupid, $activity] =
|
359 |
[$meeting, $useringroup, $usernotingroup, $groupid, $activity] =
|
| 360 |
$this->prepare_meeting(instance::TYPE_ALL, null, NOGROUPS, true);
|
360 |
$this->prepare_meeting(instance::TYPE_ALL, null, NOGROUPS, true);
|
| 361 |
$this->setUser($useringroup);
|
361 |
$this->setUser($useringroup);
|
| 362 |
$this->join_meeting($meeting->join(logger::ORIGIN_BASE));
|
362 |
$this->join_meeting($meeting->join(logger::ORIGIN_BASE));
|
| Línea 373... |
Línea 373... |
| 373 |
/**
|
373 |
/**
|
| 374 |
* Test that attendees returns the right list of attendees
|
374 |
* Test that attendees returns the right list of attendees
|
| 375 |
*
|
375 |
*
|
| 376 |
* @covers ::get_attendees
|
376 |
* @covers ::get_attendees
|
| 377 |
*/
|
377 |
*/
|
| 378 |
public function test_participant_count() {
|
378 |
public function test_participant_count(): void {
|
| 379 |
$this->resetAfterTest();
|
379 |
$this->resetAfterTest();
|
| 380 |
[$meeting, $useringroup, $usernotingroup, $groupid, $activity] =
|
380 |
[$meeting, $useringroup, $usernotingroup, $groupid, $activity] =
|
| 381 |
$this->prepare_meeting(instance::TYPE_ALL, null, NOGROUPS, true);
|
381 |
$this->prepare_meeting(instance::TYPE_ALL, null, NOGROUPS, true);
|
| 382 |
$this->setUser($useringroup);
|
382 |
$this->setUser($useringroup);
|
| 383 |
$this->join_meeting($meeting->join(logger::ORIGIN_BASE));
|
383 |
$this->join_meeting($meeting->join(logger::ORIGIN_BASE));
|