From 9eaf63b74639242fb7789bcd90673e3649a80492 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 18 May 2017 11:37:02 +1200 Subject: [PATCH] Fix some tests. --- classes/structure.php | 11 +++++++++-- tests/behat/report.feature | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/classes/structure.php b/classes/structure.php index 6a16719..44c3302 100644 --- a/classes/structure.php +++ b/classes/structure.php @@ -440,8 +440,15 @@ class mod_attendance_structure { $sess->description = $description; $sess->lasttaken = 0; $sess->lasttakenby = 0; - $sess->studentscanmark = 0; - $sess->studentpassword = ''; + if (!isset($sess->studentscanmark)) { + $sess->studentscanmark = 0; + } + if (!isset($sess->studentpassword)) { + $sess->studentpassword = ''; + } + if (!isset($sess->subnet)) { + $sess->subnet = ''; + } $event->add_record_snapshot('attendance_sessions', $sess); $event->trigger(); diff --git a/tests/behat/report.feature b/tests/behat/report.feature index a1c0866..6a8e220 100644 --- a/tests/behat/report.feature +++ b/tests/behat/report.feature @@ -239,4 +239,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 \ No newline at end of file