1006 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
7a0d024e60 MDL-73659 phpunit: restore_date, api, rule, plugin, manager & helper
All restore_date_test, api_test, rule_test, plugin_test,
manager_test, helper_test testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- All restore_date_test cases have been put under xxx\backup
  level 2 (valid API) namespace.
2022-02-05 00:03:32 +01:00
Safat Shahin
111951d861 MDL-71696 mod_quiz: quiz updates and behat coverage
The versioning changes will require some major changes
in the backup and restore of question bank and its
elements. This change introduces those changes to make
it compatible with the new world of versioning in question
bank. This commit also removes quiz_slots fields and
quiz_slot_tags table.
This commit will also introduce the versioning db
structure and some major changes to the quiz
and quiz attempts for the question, random
question and the view.
This commit implements the behat changes for versioning
in core question and associated locations.
2022-02-03 22:22:44 +11:00
Ilya Tregubov
57fe1a3099 Merge branch 'MDL-67853-master' of https://github.com/crazyserver/moodle 2022-01-27 16:41:19 +02:00
Pau Ferrer Ocaña
d195956f3a MDL-67853 message: Translate user message preference from restore and WS 2022-01-27 15:22:15 +01:00
Sara Arjona
53fe23d8b5 MDL-73347 behat: Add blocks hidden by default for boost
For the boost them, a few themes have been hidden by default.
The unaddable setting should be set to let admins add them again,
because some behat tests need them.
2022-01-14 13:08:48 +01:00
Ilya Tregubov
30148593b2 Merge branch 'MDL-71949-fix-backup-log-master' of https://github.com/matthewhilton/moodle 2022-01-12 11:40:56 +02:00
Matthew Hilton
90583e2f3b MDL-71949 backup: Fix userid and add backup ID to logging 2022-01-06 16:06:53 +10:00
Andrew Nicols
bb9741d472 MDL-72701 unit tests: Fix broken @covers annotations 2021-12-21 09:24:00 +08:00
abgreeve
fcd4de8639 MDL-72090 navigation: Update to behat feature files for navigation.
This updates feature files to use the new steps to navigate to certain
pages.
2021-12-09 11:13:35 +08:00
abgreeve
8a5e36fa06 MDL-72090 navigation: Update to existing behat steps.
This creates new general behat steps for navigating in theme
boost and classic.
2021-12-09 11:13:35 +08:00
Ilya Tregubov
638c8c452c Merge branch 'MDL-72875-master-v2' of https://github.com/peterRd/moodle 2021-12-03 14:29:59 +02:00
Peter Dias
3cddee197f MDL-72875 course: Update behat test to use the tertiary nav 2021-12-02 13:09:12 +08:00
Paul Holden
74f1879000 MDL-72728 behat: switch import course steps to native execute method.
The previous iteration using the behat_form_field class directly
didn't explicitly require the file that defines this class, and in
Goutte runs this led to fatal errors (class not found).
2021-11-26 18:58:49 +00:00
Eloy Lafuente (stronk7)
c3a89cc550 MDL-72950 restore: Avoid qcat conflicts with matching contexts
Though it's really rare for this to happen (it only was discovered
when running unit tests with Oracle), it's possible to get
problems restoring courses when context ids in the backup file
do match existing contexts in the restore target site in certain
ways (see the issue for more information).

This change just ensures that every call to the method (that
happens 4 times, for sys, coursecat, course and module levels):

prechek_precheck_qbanks_by_level()

Is processed always for that level. Before the patch it was
possible (hardly but possible) to return question categories
belonging to another level when some qcats contexts were matching
between the backup file and the target site.
2021-11-05 18:52:18 +01:00
Mihail Geshoski
6c0e1eee94 MDL-71913 mod_data: Update behat tests 2021-10-13 11:05:30 +08:00
Paul Holden
0645319e62 MDL-72309 course: make category a required field in forms.
Course category fields were changed en masse from simple select
elements to autocompletes in 93d72205, but weren't defined as
required fields. This could lead to exceptions and/or unexpected
behaviour if their values were cleared prior to form submission.
2021-10-04 08:11:32 +01:00
Eloy Lafuente (stronk7)
433212a33e Merge branch 'MDL-72093-master' of git://github.com/mihailges/moodle 2021-09-16 00:32:47 +02:00
Eloy Lafuente (stronk7)
9049ec5dd3 Merge branch '71093-master-backup-honor-formatstringstriptags' of https://github.com/DSI-Universite-Rennes2/moodle 2021-09-14 22:21:55 +02:00
Mihail Geshoski
7d821080f0 MDL-72093 navigation: Update behat tests 2021-09-14 12:02:35 +08:00
Eloy Lafuente (stronk7)
f13dc10e0a Merge branch 'MDL-71121' of https://github.com/paulholden/moodle 2021-08-31 23:12:58 +02:00
Eloy Lafuente (stronk7)
c25fe3a183 Merge branch 'MDL-71055-master' of git://github.com/andrewnicols/moodle 2021-08-23 23:22:15 +02:00
Andrew Nicols
891d1bfad3 MDL-71055 behat: Update core settings to use generator
These changes have only been applied to settings which were already
using settings names and values, but which were still using the UI.
2021-08-23 12:23:03 +08:00
Andrew Nicols
c79d58a50b MDL-71209 behat: Fix behat for new changes
Co-authored-by: Ilya Tregubov <ilya@moodle.com>
2021-08-20 16:49:06 +02:00
Julien Boulen
196cb4e1f0 MDL-71093 backup: fix backup when activity names use HTML tags 2021-08-19 11:09:27 +02:00
Tim Hunt
e7880337ad MDL-72265 backup: fix checking of override capabilites on restore
Thanks to Peter Dias <peter@moodle.com> for his help with the unit test.
2021-08-05 13:54:59 +01:00
Paul Holden
4e29417b7a MDL-71121 backup: apply config defaults for async backups. 2021-08-02 23:27:18 +01:00
Andrew Nicols
4f422785c6 MDL-71113 javascript: Improve basic JS Documentation 2021-06-18 09:38:05 +08:00
Andrew Nicols
92179b7057 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Mikhail Golenkov
ed5e808052 MDL-70337 backup: Enhance automated backup logs readability 2021-05-24 10:29:02 +10:00
David Mudrák
03402e3c5d MDL-71580 lang: Fix reworded strings in tests 2021-05-12 17:10:16 +02:00
Ilya Tregubov
cf1cf222e7 MDL-66431 core: Fix behat tests.
Move activity creation to data generators. Only fixing those
tests failing due to removing usemodchooser preference.
2021-05-01 16:22:03 +02:00
Adrian Greeve
d4673e3047 Merge branch 'MDL-71051-master-2' of git://github.com/marinaglancy/moodle 2021-04-29 09:27:07 +08:00
Marina Glancy
5682b9a585 MDL-71051 core_user: always use API when working with profile fields 2021-04-28 11:39:04 +02:00
Andrew Nicols
aa6c02a74c Merge branch 'MDL-71389-master' of git://github.com/marinaglancy/moodle 2021-04-28 09:14:48 +08:00
abgreeve
8a53fe7f6b Merge branch 'MDL-28452-master' of git://github.com/bmbrands/moodle 2021-04-22 09:38:50 +08:00
Marina Glancy
263c39ba21 MDL-71389 various: changes to unittests due to php8 changes:
- some engine error messages changed
- some warning levels changed
- the carriage return symbol randomly appears
- one phpunit assertion fails and not really representative of anything
2021-04-21 12:38:46 +02:00
Bas Brands
f9e1c2587a MDL-28452 core_user: migrate social profile fields
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.

AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
2021-04-21 11:22:25 +02:00
Eloy Lafuente (stronk7)
7c75781518 Merge branch 'MDL-63381_master_v3' of https://github.com/TomoTsuyuki/moodle 2021-04-20 23:56:56 +02:00
Sara Arjona
ef557b970f MDL-69331 core_h5p: fix behat errors 2021-04-16 11:09:02 +02:00
Sara Arjona
39263ddb62 MDL-69331 core_h5p: Add missing @core_h5p tag 2021-04-15 09:16:36 +02:00
Sara Arjona
f3d43c76bc MDL-69331 core_h5p: Add missing library files to behat tests
Some of the pre-existing behat tests were creating content into the
content bank using the generator but the H5P content-type libraries
weren't uploaded.
Since MDL-69331, libraries need to be deployed previously (so fake
H5P content-type won't be displayed if these libraries don't exist).
2021-04-15 09:16:36 +02:00
Tomo Tsuyuki
108da43e9f MDL-63381 backup: Have an option to import permissions
Add options to use permission settings for import / restore
2021-04-13 13:24:15 +10:00
Mihail Geshoski
5cc31c3691 MDL-67870 backup: Skip value change if setting is locked by hierarchy
The given condition in the if statement did not take into account cases
when the setting is locked by hierarchy. Settings which are locked by
hierarchy should should keep their current values which were inherited
from the parent.
2021-03-22 15:32:49 +08:00
Eloy Lafuente (stronk7)
e3a46964dc Merge branch 'MDL-70901-master' of git://github.com/marinaglancy/moodle 2021-03-18 00:40:46 +01:00
Jun Pataleta
ebf078458d Merge branch 'MDL-71036' of https://github.com/stronk7/moodle 2021-03-17 20:05:25 +08:00
Eloy Lafuente (stronk7)
ba5b6089d5 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 19:22:24 +01:00
Mikhail Golenkov
e9eb3ad6c5 MDL-71044 backup: backup_cleanup_task task to remove old files 2021-03-07 21:46:47 +11:00
Jun Pataleta
2b113fd93c Merge branch 'MDL-70876' of https://github.com/stronk7/moodle 2021-03-02 16:02:52 +08:00
Eloy Lafuente (stronk7)
bf2b1b18b5 Merge branch 'MDL-70898-master' of git://github.com/marinaglancy/moodle 2021-03-01 22:50:33 +01:00
Eloy Lafuente (stronk7)
08ae245926 MDL-70876 php80: 5th param removed from custom error handlers
It was deprecated in php72 and now it's gone.

Have used this regexp to find all the uses in core:

ag set_error_handler | uniq

And then checked all them manually, that parameter was not
being used in the 3 methods where we are removing it.
2021-02-26 13:08:27 +01:00