Commit graph

100169 commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
c989d6ec61 MDL-71036 phpunit: Renamed various regexp-related assertions
In PHPUnit 9.1, the following regexp-related assertions
have been deprecated and there are new alternatives for
all them:
    - assertRegExp()     -> assertMatchesRegularExpression()
    - assertNotRegExp()  -> assertDoesNotMatchRegularExpression()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

    ag 'assertRegExp|assertNotRegExp' -li
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7)
cbf01aa79a MDL-71036 phpunit: Renamed various file-related assertions
In PHPUnit 9.1, the following file-related assertions
have been deprecated and there are new alternatives for
all them:
- assertNotIsReadable()         -> assertIsNotReadable()
- assertNotIsWritable()         -> assertIsNotWritable()
- assertDirectoryNotExists()    -> assertDirectoryDoesNotExist()
- assertDirectoryNotIsReadable()-> assertDirectoryIsNotReadable()
- assertDirectoryNotIsWritable()-> assertDirectoryIsNotWritable()
- assertFileNotExists()         -> assertFileDoesNotExist()
- assertFileNotIsReadable()     -> assertFileIsNotReadable()
- assertFileNotIsWritable()     -> assertFileIsNotWritable()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

ag 'assertNotIsReadable|assertNotIsWritable|assertDirectoryNotExists|\
assertDirectoryNotIsReadable|assertDirectoryNotIsWritable|\
assertFileNotExists|assertFileNotIsReadable|assertFileNotIsWritable'
2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7)
87680e8b2b MDL-71036 phpunit: Stricter signature matching 2021-03-11 23:07:30 +01:00
Eloy Lafuente (stronk7)
77f09eccfe MDL-71036 phpunit: Bump to phpunit 9.5.x 2021-03-11 19:34:28 +01:00
Sara Arjona
295901e6a1 weekly release 3.11dev 2021-03-11 17:18:44 +01:00
Sara Arjona
4d1323a8a8 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-03-11 17:18:42 +01:00
Jun Pataleta
9fe5ab67f1 Merge branch 'MDL-70911-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-11 17:41:25 +08:00
Sara Arjona
9b74408a33 MDL-70911 core_badges: Add navigation menu in classic
Manage backpacks page wasn't displaying the navigation and administration
menus when using classic theme (it's unrelated to changes done here).
This patch fixes this unexpected behaviour (raised thanks to behat tests).
2021-03-11 09:02:23 +01:00
Adrian Greeve
fefc5d6421 Merge branch 'MDL-66025-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-11 11:43:26 +08:00
Adrian Greeve
24ee5bc2c3 Merge branch 'MDL-71026-311' of git://github.com/ilyatregubov/moodle into MOODLE_311_STABLE 2021-03-11 11:03:28 +08:00
Eloy Lafuente (stronk7)
bb4d5dbc25 Merge branch 'MDL-70726-3.11' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-03-11 00:11:44 +01:00
Eloy Lafuente (stronk7)
ca6b26fae7 Merge branch 'MDL-70789-311' of git://github.com/paulholden/moodle into MOODLE_311_STABLE 2021-03-10 23:52:46 +01:00
Eloy Lafuente (stronk7)
3841ce68cf Merge branch 'MDL-70891-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-10 23:40:07 +01:00
Eloy Lafuente (stronk7)
58afea8c59 Merge branch 'MDL-70967-311' of git://github.com/marinaglancy/moodle into MOODLE_311_STABLE 2021-03-10 23:39:15 +01:00
Sara Arjona
266742e6b4 Merge branch 'MDL-70287-311-3' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-03-10 20:48:57 +01:00
Jun Pataleta
ad583bba25 MDL-70815 completion: Cast custom data to array
Since cm_info::customdata can be of any type, we need to cast it to an
array first before checking for custom completion rules. Otherwise,
an exception can be thrown (e.g. customdata has been set as an stdClass)
2021-03-10 19:23:04 +01:00
Jun Pataleta
b535cf958a Merge branch 'MDL-45242-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-03-10 23:38:42 +08:00
sam marshall
3cc4d3d2e2 MDL-45242 Course: Enrol feature supports custom profile fields 2021-03-10 10:58:09 +00:00
sam marshall
4f435cc40f MDL-45242 Course: Participants list supports custom profile fields 2021-03-10 10:58:09 +00:00
sam marshall
1d7d3c984d MDL-45242 Admin: User list supports custom profile fields 2021-03-10 10:58:09 +00:00
sam marshall
0919a04311 MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:58:09 +00:00
Jun Pataleta
5e7aeb7841 Merge branch 'MDL-70911-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-10 16:15:36 +08:00
Sara Arjona
52fd43f54d MDL-70911 core_badges: Remove $CFG->badges_site_backpack
The $CFG->badges_site_backpack setting has been completely removed
because it's not required anymore. From now, the primary site
backpack will be the first one in the "Manage backpacks" list (so,
the one with lower sortorder value).
2021-03-10 09:10:32 +01:00
Sara Arjona
3de96274ff MDL-70911 core_badges: Add support to backpacks sortorder
Before removing $CFG->badges_site_backpack setting, admins should be
able to re-order the existing site-backpacks (because then, the first
one will be treated as the default one).
This patch adds the sort order feature to the backpack list.
2021-03-10 08:31:22 +01:00
Sara Arjona
1a2db1297b MDL-70911 core_badges: Move "External backpack" to badges settings
Setting "External backpack connection" has been moved from "Backpack
settings" to "Badges settings" in order to make easier to find and
configure it.
Some extra tests have been added to cover existing behaviour and
confirm is still working as expected.
2021-03-10 08:31:22 +01:00
AMOS bot
d6d83cead2 Automatically generated installer lang files 2021-03-10 00:07:24 +00:00
Eloy Lafuente (stronk7)
b7b508c5d2 Merge branch 'MDL-63961-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-10 00:19:58 +01:00
Sara Arjona
6e2a35733d Merge branch 'MDL-70608-311-langimportasync' of git://github.com/mudrd8mz/moodle into MOODLE_311_STABLE 2021-03-09 16:43:01 +01:00
Sara Arjona
b8f38fc98b Merge branch 'MDL-70815-311-6' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-03-09 15:18:33 +01:00
Sara Arjona
3d10e6fd7f Merge branch 'MDL-70855-MOODLE_311_STABLE' of https://github.com/dmitriim/moodle into MOODLE_311_STABLE 2021-03-09 14:57:04 +01:00
Jun Pataleta
1292b31ac5 MDL-70815 completion: Test internal_get_state() with custom completion
Use the custom completion implementation for mod_choice to test
completion_info::get_state() to cover the case where the completion
state is being determined from the custom completion condition.
2021-03-09 20:19:00 +08:00
Jun Pataleta
f2599eb895 MDL-70815 mod_choice: Unit tests for the custom completion class 2021-03-09 20:19:00 +08:00
Jun Pataleta
4a9aeeca59 MDL-70815 mod_choice: Custom completion implementation 2021-03-09 20:19:00 +08:00
Jun Pataleta
ad5b613c86 MDL-70815 core_completion: Update completion_info
* Update completion_info::get_data() to add other completion
information from a new method called get_other_cm_completion_data().
This allows the storage of the completion statuses of the following
completion rules to completion_info objects:
  - 'Students must receive a grade' completion rule.
  - Any custom completion rule defined by an activity.
This allows detailed completion information to be fetched for course
modules.
It also allows custom completion statuses to be cached which will help
reduce DB queries when fetching completion statuses.
* Update update_state() to fetch overall completion state from the
module's activity_custom_completion implementation. Falls back to the
*_get_completion_state() callback function.
* Update internal_set_data() to include the other cm completion data
in the updated cache data for the module instance.
2021-03-09 20:18:59 +08:00
Jun Pataleta
31fcbfc2e2 MDL-70815 core_completion: completion_info::get_grade_completion()
Move the current logic for determining the completion status for the
"Student must receive grade" completion rule to a function so it cann
be reused.
Unit test included.
2021-03-09 20:18:59 +08:00
Jun Pataleta
baa0001037 MDL-70815 core_completion: Fix unit tests
* Unit tests for completion_info::get_data() and
completion_info::internal_get_state are mocked which causes failures
with the new implementation. It's more straightforward and realistic
to generate real course and modules to test these methods.
2021-03-09 20:18:59 +08:00
Jun Pataleta
e789f013b4 MDL-70815 core_completion: Unit tests for activity_custom_completion
Tests cover
 - get_overall_completion_state()
 - is_available()
 - validate_rule()
Tests don't cover
 - methods that rely on static methods such as:
   - is_defined()
 - static methods in the class because they can't be mocked
 - abstract methods that can be tested better by the plugins
   that extend activity_custom_completion such as:
   - get_state()
   - get_defined_custom_rules()
   - get_custom_rule_descriptions()
2021-03-09 20:18:59 +08:00
Jun Pataleta
6d2e36aa37 MDL-70815 core_completion: Activity custom completion details base class
* Base class for defining an activity module's custom completion details
2021-03-09 20:18:59 +08:00
Sara Arjona
217377d30f Merge branch 'MDL-70766-auth-config-log-MOODLE_311_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_311_STABLE 2021-03-08 11:39:19 +01:00
sam marshall
5b7b1b9a06 MDL-45242 Lib: Replace direct references to ->showuseridentity 2021-03-08 09:17:04 +00:00
sam marshall
947d8c7806 MDL-45242 Lib: Deprecate field-related library functions 2021-03-08 09:17:04 +00:00
sam marshall
68e576b0ed MDL-45242 Lib: Allow custom profile fields in showuseridentity 2021-03-08 09:17:03 +00:00
sam marshall
f21cf5bc86 MDL-45242 Testing: Generators for user profile fields 2021-03-08 09:17:03 +00:00
sam marshall
23c20dc23f MDL-45242 Admin: Added lazy-loading callback to multicheckbox
Currently admin_setting_configselect has lazy-loading support via a
callback function (so you don't have to make pointless single-use
classes for each unusual setting), but this is not present in other
similar types.

This commit adds identical support to
admin_setting_configmulticheckbox.
2021-03-08 09:17:03 +00:00
AMOS bot
2e4ed73845 Automatically generated installer lang files 2021-03-07 00:07:24 +00:00
AMOS bot
f0b5d067bf Automatically generated installer lang files 2021-03-06 00:07:24 +00:00
Sara Arjona
f23ffe6645 weekly release 3.11dev 2021-03-05 16:01:36 +01:00
Sara Arjona
c644d61c34 Merge branch 'install_311_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_311_STABLE 2021-03-05 16:01:34 +01:00
Amaia Anabitarte
291ff443a5 MDL-70726 behat: Fixing existing fail tests
Some of the current behat tests were wrong but not failing because of the bug in 'should not exist' step.
Once the bug is fixed, we must fix also wrong behats.
2021-03-05 14:06:43 +07:00
Ilya Tregubov
02af750568 MDL-69680 lib: Fix behat test backup_and_restore.feature 2021-03-04 22:51:18 +01:00