Browse Source

Fix coding guideline issues.

nwp90-nwp90-allsessionsreport
Dan Marsden 5 years ago
parent
commit
604757d0d9
  1. 1
      .travis.yml
  2. 3
      externallib.php
  3. 12
      tests/externallib_test.php

1
.travis.yml

@ -24,6 +24,7 @@ php:
env: env:
global: global:
- MOODLE_BRANCH=master - MOODLE_BRANCH=master
- MUSTACHE_IGNORE_NAMES=mobile_teacher_form.mustache
matrix: matrix:
- DB=pgsql - DB=pgsql
- DB=mysqli - DB=mysqli

3
externallib.php

@ -531,7 +531,8 @@ class mod_attendance_external extends external_api {
// TODO: Verify statusset and statusid. // TODO: Verify statusset and statusid.
return attendance_handler::update_user_status($params['sessionid'], $params['studentid'], $params['takenbyid'], $params['statusid'], $params['statusset']); return attendance_handler::update_user_status($params['sessionid'], $params['studentid'], $params['takenbyid'],
$params['statusid'], $params['statusset']);
} }
/** /**

12
tests/externallib_test.php

@ -219,7 +219,8 @@ class mod_attendance_external_testcase extends externallib_advanced_testcase {
$status = array_pop($sessioninfo['statuses']); $status = array_pop($sessioninfo['statuses']);
$statusset = $sessioninfo['statusset']; $statusset = $sessioninfo['statusset'];
$result = mod_attendance_external::update_user_status($session['id'], $student['id'], $this->teacher->id, $status['id'], $statusset); $result = mod_attendance_external::update_user_status($session['id'], $student['id'], $this->teacher->id,
$status['id'], $statusset);
$result = external_api::clean_returnvalue(mod_attendance_external::update_user_status_returns(), $result); $result = external_api::clean_returnvalue(mod_attendance_external::update_user_status_returns(), $result);
$sessioninfo = attendance_handler::get_session($session['id']); $sessioninfo = attendance_handler::get_session($session['id']);
@ -317,7 +318,8 @@ class mod_attendance_external_testcase extends externallib_advanced_testcase {
// Create attendance with separate groups mode. // Create attendance with separate groups mode.
$attendancesepgroups = mod_attendance_external::add_attendance($course->id, 'sepgroups', 'test', SEPARATEGROUPS); $attendancesepgroups = mod_attendance_external::add_attendance($course->id, 'sepgroups', 'test', SEPARATEGROUPS);
$attendancesepgroups = external_api::clean_returnvalue(mod_attendance_external::add_attendance_returns(), $attendancesepgroups); $attendancesepgroups = external_api::clean_returnvalue(mod_attendance_external::add_attendance_returns(),
$attendancesepgroups);
// Check attendance exist. // Check attendance exist.
$this->assertCount(1, $DB->get_records('attendance', ['course' => $course->id])); $this->assertCount(1, $DB->get_records('attendance', ['course' => $course->id]));
@ -358,7 +360,8 @@ class mod_attendance_external_testcase extends externallib_advanced_testcase {
$this->setUser($teacher); $this->setUser($teacher);
// Create attendance with no groups mode. // Create attendance with no groups mode.
$attendancenogroups = mod_attendance_external::add_attendance($course->id, 'nogroups', 'test', NOGROUPS); $attendancenogroups = mod_attendance_external::add_attendance($course->id, 'nogroups',
'test', NOGROUPS);
$attendancenogroups = external_api::clean_returnvalue(mod_attendance_external::add_attendance_returns(), $attendancenogroups); $attendancenogroups = external_api::clean_returnvalue(mod_attendance_external::add_attendance_returns(), $attendancenogroups);
// Check attendance exist. // Check attendance exist.
@ -384,7 +387,8 @@ class mod_attendance_external_testcase extends externallib_advanced_testcase {
// Create attendance with visible groups mode. // Create attendance with visible groups mode.
$attendancevisgroups = mod_attendance_external::add_attendance($course->id, 'visgroups', 'test', VISIBLEGROUPS); $attendancevisgroups = mod_attendance_external::add_attendance($course->id, 'visgroups', 'test', VISIBLEGROUPS);
$attendancevisgroups = external_api::clean_returnvalue(mod_attendance_external::add_attendance_returns(), $attendancevisgroups); $attendancevisgroups = external_api::clean_returnvalue(mod_attendance_external::add_attendance_returns(),
$attendancevisgroups);
// Check attendance exist. // Check attendance exist.
$this->assertCount(1, $DB->get_records('attendance', ['course' => $course->id])); $this->assertCount(1, $DB->get_records('attendance', ['course' => $course->id]));

Loading…
Cancel
Save