Skip to content
Permalink
Browse files

MDL-45362 Availability: Behat test fails on first of month

  • Loading branch information...
sammarshallou committed May 1, 2014
1 parent f500ff4 commit a3a24239825f141ebb4d323d6ca9841b2682ac71
@@ -204,10 +204,9 @@ protected function show_time($time, $dateonly, $until = false) {
* timezone).
*
* @param int $time Time
* @return bool True if time refers to midnight, false if it's some other
* time or if it is set to zero
* @return bool True if time refers to midnight, false otherwise
*/
protected static function is_midnight($time) {
return $time && usergetmidnight($time) == $time;
return usergetmidnight($time) == $time;
}
}
@@ -4,6 +4,24 @@ Feature: display_availability
As a user
I need to see appropriate availability restrictions for activities and sections

# PURPOSE OF THIS TEST FEATURE:
#
# This test is to do a basic check of the user interface relating to display
# of availability conditions - i.e. if there's a condition, does it show up;
# are we doing the HTML correctly; does it correctly hide an activity where
# the options are set to not show it at all.
#
# Things this test is not:
# - It is not a test of the date condition specifically. The date condition is
# only used as an example in order to get the availability information to
# display. (The date condition has its own Behat test in
# /availability/condition/date/tests/behat.)
# - It is not a complete test of the logic. This is supposed to be a shallow
# check of the user interface parts and doesn't cover all logical
# possibilities. The logic is tested in PHPUnit tests instead, which are
# much more efficient. (Again there are unit tests for the overall system
# and for each condition type.)

Background:
Given the following "courses" exist:
| fullname | shortname | format |
@@ -39,7 +57,7 @@ Feature: display_availability
And I click on "Date" "button" in the "Add restriction..." "dialogue"
And I set the field "direction" to "until"
And I set the field "x[year]" to "2013"
And I set the field "x[month]" to "January"
And I set the field "x[month]" to "March"
And I press "Save and return to course"

# Add a Page with 2 restrictions - one is set to hide from students if failed.
@@ -53,7 +71,7 @@ Feature: display_availability
And I click on "Date" "button" in the "Add restriction..." "dialogue"
And I set the field "direction" to "until"
And I set the field "x[year]" to "2013"
And I set the field "x[month]" to "January"
And I set the field "x[month]" to "March"
And I click on ".availability-item .availability-eye img" "css_element"
And I press "Add restriction..."
And I click on "User profile" "button" in the "Add restriction..." "dialogue"
@@ -4,6 +4,17 @@ Feature: edit_availability
As a teacher
I need to set up availability options for activities and sections

# PURPOSE OF THIS TEST FEATURE:
#
# This test covers the user interface around editing availability conditions,
# especially the JavaScript code which is not tested elsewhere (e.g. does the
# 'Add restriction' dialog work). It tests both forms and also the admin
# setting interface.
#
# This test does not check the detailed behaviour of the availability system,
# which is mainly covered in PHPUnit (and, from the user interface
# perspective, in the other Behat tests for each type of condition).

Background:
Given the following "courses" exist:
| fullname | shortname | format |

0 comments on commit a3a2423

Please sign in to comment.
You can’t perform that action at this time.