diff --git a/CHANGES.md b/CHANGES.md
index 565285b8dbd9eb5c5ca5a5e4ad87f92f1215b481..4bb386d04c0fd6c10becf70b1fa2c38e75fe2dda 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -4,6 +4,10 @@ moodle-theme_boost_campus
 Changes
 -------
 
+### Unreleased
+
+* 2021-03-14 - Fix Behat test for unrestricted self enrolment hint
+
 ### v3.10-r4
 
 * 2021-03-13 - Bugfix: Option to output the information banner without any particular Bootstrap color was broken on the login page.
diff --git a/tests/behat/theme_boost_campus_course_layout_settings.feature b/tests/behat/theme_boost_campus_course_layout_settings.feature
index 18a3b92b2be4f76a488f606fe0ad069e32f95be2..9b84c05eb6a3a06d6c581cf5fc2026bbb6347cc2 100644
--- a/tests/behat/theme_boost_campus_course_layout_settings.feature
+++ b/tests/behat/theme_boost_campus_course_layout_settings.feature
@@ -197,76 +197,120 @@ Feature: Configuring the theme_boost_campus plugin for the "Course Layout settin
     And I set the following fields to these values:
       | id_enrolstartdate_enabled | 0             |
       | id_enrolenddate_enabled   | 1             |
-      | id_enrolenddate           | ##yesterday## |
+    # We can't use the ##yesterday## notation here.
+      | id_enrolenddate_day       | 1             |
+      | id_enrolenddate_month     | January       |
+      | id_enrolenddate_year      | 2019          |
+      | id_enrolenddate_hour      | 00            |
+      | id_enrolenddate_minute    | 00            |
     And I press "Save changes"
     And I am on "Course 1" course homepage
     Then I should not see "This course is currently visible and an unrestricted self enrolment is active: \"Self enrolment (Student)\""
     And ".course-selfenrol-infobox" "css_element" should not exist
-
     When I navigate to "Users > Enrolment methods" in current page administration
     And I click on "Edit" "link" in the "Self enrolment (Student)" "table_row"
     And I set the following fields to these values:
-      | id_enrolstartdate_enabled | 0            |
-      | id_enrolenddate_enabled   | 1            |
-      | id_enrolenddate           | ##tomorrow## |
+      | id_enrolstartdate_enabled | 0             |
+      | id_enrolenddate_enabled   | 1             |
+    # We can't use the ##tomorrow## notation here. This test will break in the year 2050.
+      | id_enrolenddate_day       | 1             |
+      | id_enrolenddate_month     | January       |
+      | id_enrolenddate_year      | 2050          |
+      | id_enrolenddate_hour      | 00            |
+      | id_enrolenddate_minute    | 00            |
     And I press "Save changes"
     And I am on "Course 1" course homepage
     Then I should see "This course is currently visible and an unrestricted self enrolment is active: \"Self enrolment (Student)\"."
     And ".course-selfenrol-infobox" "css_element" should exist
-
     When I navigate to "Users > Enrolment methods" in current page administration
     And I click on "Edit" "link" in the "Self enrolment (Student)" "table_row"
     And I set the following fields to these values:
       | id_enrolstartdate_enabled | 1             |
-      | id_enrolstartdate         | ##yesterday## |
+    # We can't use the ##yesterday## notation here.
+      | id_enrolstartdate_day     | 1             |
+      | id_enrolstartdate_month   | January       |
+      | id_enrolstartdate_year    | 2019          |
+      | id_enrolstartdate_hour    | 00            |
+      | id_enrolstartdate_minute  | 00            |
       | id_enrolenddate_enabled   | 0             |
     And I press "Save changes"
     And I am on "Course 1" course homepage
     Then I should see "This course is currently visible and an unrestricted self enrolment is active: \"Self enrolment (Student)\"."
     And ".course-selfenrol-infobox" "css_element" should exist
-
     When I navigate to "Users > Enrolment methods" in current page administration
     And I click on "Edit" "link" in the "Self enrolment (Student)" "table_row"
     And I set the following fields to these values:
-      | id_enrolstartdate_enabled | 1            |
-      | id_enrolstartdate         | ##tomorrow## |
-      | id_enrolenddate_enabled   | 0            |
+      | id_enrolstartdate_enabled | 1             |
+    # We can't use the ##tomorrow## notation here. This test will break in the year 2050.
+      | id_enrolstartdate_day     | 1             |
+      | id_enrolstartdate_month   | January       |
+      | id_enrolstartdate_year    | 2050          |
+      | id_enrolstartdate_hour    | 00            |
+      | id_enrolstartdate_minute  | 00            |
+      | id_enrolenddate_enabled   | 0             |
     And I press "Save changes"
     And I am on "Course 1" course homepage
     Then I should not see "This course is currently visible and an unrestricted self enrolment is active: \"Self enrolment (Student)\"."
     And ".course-selfenrol-infobox" "css_element" should not exist
-
     When I navigate to "Users > Enrolment methods" in current page administration
     And I click on "Edit" "link" in the "Self enrolment (Student)" "table_row"
     And I set the following fields to these values:
-      | id_enrolstartdate_enabled | 1                     |
-      | id_enrolstartdate         | ##Monday next week##  |
-      | id_enrolenddate_enabled   | 1                     |
-      | id_enrolenddate           | ##Tuesday next week## |
+      | id_enrolstartdate_enabled | 1             |
+    # We can't use the ##Monday next week## notation here. This test will break in the year 2050.
+      | id_enrolstartdate_day     | 1             |
+      | id_enrolstartdate_month   | January       |
+      | id_enrolstartdate_year    | 2050          |
+      | id_enrolstartdate_hour    | 00            |
+      | id_enrolstartdate_minute  | 00            |
+      | id_enrolenddate_enabled   | 1             |
+    # We can't use the ##Tuesday next week## notation here. This test will break in the year 2050.
+      | id_enrolenddate_day       | 2             |
+      | id_enrolenddate_month     | January       |
+      | id_enrolenddate_year      | 2050          |
+      | id_enrolenddate_hour      | 00            |
+      | id_enrolenddate_minute    | 00            |
     And I press "Save changes"
     And I am on "Course 1" course homepage
     Then I should not see "This course is currently visible and an unrestricted self enrolment is active: \"Self enrolment (Student)\"."
     And ".course-selfenrol-infobox" "css_element" should not exist
-
     When I navigate to "Users > Enrolment methods" in current page administration
     And I click on "Edit" "link" in the "Self enrolment (Student)" "table_row"
     And I set the following fields to these values:
       | id_enrolstartdate_enabled | 1             |
-      | id_enrolstartdate         | ##yesterday## |
+    # We can't use the ##yesterday## notation here.
+      | id_enrolstartdate_day     | 1             |
+      | id_enrolstartdate_month   | January       |
+      | id_enrolstartdate_year    | 2019          |
+      | id_enrolstartdate_hour    | 00            |
+      | id_enrolstartdate_minute  | 00            |
       | id_enrolenddate_enabled   | 1             |
-      | id_enrolenddate           | ##tomorrow##  |
+    # We can't use the ##tomorrow## notation here. This test will break in the year 2050.
+      | id_enrolenddate_day       | 1             |
+      | id_enrolenddate_month     | January       |
+      | id_enrolenddate_year      | 2050          |
+      | id_enrolenddate_hour      | 00            |
+      | id_enrolenddate_minute    | 00            |
     And I press "Save changes"
     And I am on "Course 1" course homepage
     Then I should see "This course is currently visible and an unrestricted self enrolment is active: \"Self enrolment (Student)\"."
     And ".course-selfenrol-infobox" "css_element" should exist
-
     When I navigate to "Users > Enrolment methods" in current page administration
     And I click on "Edit" "link" in the "Self enrolment (Student)" "table_row"
     And I set the following fields to these values:
-      | id_enrolstartdate_enabled | 1              |
-      | id_enrolstartdate         | ##3 days ago## |
-      | id_enrolenddate_enabled   | 1              |
-      | id_enrolenddate           | ##2 days ago## |
+      | id_enrolstartdate_enabled | 1             |
+    # We can't use the ##3 days ago## notation here.
+      | id_enrolstartdate_day     | 1             |
+      | id_enrolstartdate_month   | January       |
+      | id_enrolstartdate_year    | 2018          |
+      | id_enrolstartdate_hour    | 00            |
+      | id_enrolstartdate_minute  | 00            |
+      | id_enrolenddate_enabled   | 1             |
+    # We can't use the ##2 days ago## notation here.
+      | id_enrolenddate_day       | 1             |
+      | id_enrolenddate_month     | January       |
+      | id_enrolenddate_year      | 2019          |
+      | id_enrolenddate_hour      | 00            |
+      | id_enrolenddate_minute    | 00            |
     And I press "Save changes"
     And I am on "Course 1" course homepage
     Then I should not see "This course is currently visible and an unrestricted self enrolment is active: \"Self enrolment (Student)\"."