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. 2
      tests/behat/attendance_mod.feature
  4. 2
      tests/behat/defaultstatus.feature
  5. 2
      tests/behat/preferences.feature
  6. 2
      tests/behat/report.feature
  7. 12
      tests/externallib_test.php

1
.travis.yml

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

3
externallib.php

@ -531,7 +531,8 @@ class mod_attendance_external extends external_api {
// 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']);
}
/**

2
tests/behat/attendance_mod.feature

@ -114,4 +114,4 @@ Feature: Teachers and Students can record session attendance
And the field "id_ident_department" matches value ""
# Removed dependency on behat_download to allow automated Travis CI tests to pass.
# It would be good to add these back at some point.
# It would be good to add these back at some point.

2
tests/behat/defaultstatus.feature

@ -27,4 +27,4 @@ Feature: Admin can set default status set for use in new attendance
| Name | Attendance1 |
And I follow "Attendance1"
And I follow "Status set"
Then the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[3]/input" matches value "customstatusdescription"
Then the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[3]/input" matches value "customstatusdescription"

2
tests/behat/preferences.feature

@ -53,4 +53,4 @@ Feature: Teachers can't change status variables to have empty acronyms or descri
Then I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[1]/td[2]/p" "xpath_element"
And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[1]/td[3]/p" "xpath_element"
And I should see "Empty acronyms are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[2]/p" "xpath_element"
And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[3]/p" "xpath_element"
And I should see "Empty descriptions are not allowed" in the "//*[@id='preferencesform']/table/tbody/tr[3]/td[3]/p" "xpath_element"

2
tests/behat/report.feature

@ -213,4 +213,4 @@ Feature: Visiting reports
And "5 / 6" "text" should exist in the "Maximum possible points:" "table_row"
And "83.3%" "text" should exist in the "Maximum possible percentage:" "table_row"
And I log out
And I log out

12
tests/externallib_test.php

@ -219,7 +219,8 @@ class mod_attendance_external_testcase extends externallib_advanced_testcase {
$status = array_pop($sessioninfo['statuses']);
$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);
$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.
$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.
$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);
// 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);
// Check attendance exist.
@ -384,7 +387,8 @@ class mod_attendance_external_testcase extends externallib_advanced_testcase {
// Create attendance with visible groups mode.
$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.
$this->assertCount(1, $DB->get_records('attendance', ['course' => $course->id]));

Loading…
Cancel
Save