Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-48670

Behat tests don't work with timezone < GMT 0

    XMLWordPrintable

Details

    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • wip-mdl-48670
    • Easy
    • Hide
      1. Change system timezone to America/Anchorage
      2. Restart apache
      3. Run behat with tag @format
      4. Run behat for the following features:
        1. /course/tests/behat/course_controls.feature
        2. /course/tests/behat/paged_course_navigation.feature
        3. /course/format/weeks/tests/behat/edit_delete_sections.feature

      Ensure above test fail without patch and pass with patch.

      Show
      Change system timezone to America/Anchorage Restart apache Run behat with tag @format Run behat for the following features: /course/tests/behat/course_controls.feature /course/tests/behat/paged_course_navigation.feature /course/format/weeks/tests/behat/edit_delete_sections.feature Ensure above test fail without patch and pass with patch.

    Description

      In /course/tests/behat/course_controls.feature and /course/tests/behat/paged_course_navigation.feature, the scenario expects a "1 January - 7 January" link, being the 1st week of the course.
      But the course is created with a startdate value of 0 (=> 31/12/1969), so the 1st week is "31 December - 6 January", so the scenarios don't work.
      And that, because the timezone in our php.ini was set to "America/New_York". Setting it to "Europe/London" solved the problem.

      Maybe a specific function should be added in the Behat Data Generator, to create courses with correct start dates?

      Attachments

        Issue Links

          Activity

            People

              rajeshtaneja Rajesh Taneja
              ligned David Ligne
              David Monllaó David Monllaó
              Andrew Lyons Andrew Lyons
              Mark Nelson Mark Nelson
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Mar/15