Commit graph

28190 commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
d95c378771 MDL-67673 phpunit: Remove expectedException annotations
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

The annotations `@expectedException`, `@expectedExceptionCode`,
`@expectedExceptionMessage`, and `@expectedExceptionMessageRegExp`
are now deprecated.
Using these annotations will trigger a deprecation warning
in PHPUnit 8 and in PHPUnit 9 these annotations will be removed.

Also, all uses of expectExceptionMessageRegExp() has been moved
to expectExceptionMessageMatches(). See https://github.com/sebastianbergmann/phpunit/issues/3957

TODO: Various weirdness found while doing the changes with these tests:
- vendor/bin/phpunit lib/tests/exporter_test.php (created MDL-69700)
- vendor/bin/phpunit competency/tests/external_test.php (same issue than prev one)
- vendor/bin/phpunit question/engine/tests/questionengine_test.php (created MDL-69624)
- vendor/bin/phpunit lib/tests/event_test.php (created MDL-69688)
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
598d578af7 MDL-67673 phpunit: Remove deprecated assertArraySubset()
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

assertArraySubset() is deprecated and will be removed in PHPUnit 9.
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
f94195c320 MDL-67673 phpunit: Remove deprecated assertInternalType()
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

assertInternalType() is deprecated and will be removed in
PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(),
assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(),
assertIsResource(), assertIsString(), assertIsScalar(),
assertIsCallable(), or assertIsIterable() instead.
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
80be8d2204 MDL-67673 phpunit: phpunit_constraint_object_is_equal_with_exceptions
Constraints are now declared final, so we cannot extend them anymore.

Hence, instead of extending PHPUnit\Framework\Constraint\IsEqual we
are just wrapping it into our constraint.
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
bdc3ad00c9 MDL-67673 phpunit: Bump to PHPUnit 8.5 and remove DBunit
This makes everything to break, but it's what we'll be fixing
in the next commits, heh. :-)

Generated with php72 (min version supported), following the
instructions @ https://docs.moodle.org/dev/Composer
2020-10-21 12:45:59 +02:00
Paul Holden
7337934484 MDL-69788 admin: validate language menu configuration. 2020-10-21 11:24:26 +01:00
Neill Magill
661fa18e07 MDL-69553 output: Handle pre-loading multiline string defines
Before this patch strings that were declared over multiple lines in
a template would not be parsed correctly.

{{#str}}value,
mod_forum{{/str}}

would have been been parsed to get_string('value', 'core')

{{#str}}
value, mod_forum
{{/str}}

would have been been parsed to get_string('', 'core')
2020-10-21 10:08:56 +01:00
Neill Magill
b65c22de20 MDL-69553 output: Unit tests for loading multiline string defines 2020-10-21 10:08:54 +01:00
Adrian Greeve
56c172af7e Merge branch 'MDL-69807' of https://github.com/paulholden/moodle 2020-10-21 14:13:07 +08:00
Adrian Greeve
5dc282a0d3 Merge branch 'MDL-68766-master' of https://github.com/ised-isde-canada/moodle 2020-10-21 12:55:11 +08:00
Jake Dallimore
b64a8b3675 Merge branch 'MDL-68983-recent-session-lock-ro' of https://github.com/brendanheywood/moodle 2020-10-21 12:45:36 +08:00
Jake Dallimore
3d0f28ebb8 Merge branch 'MDL-69751-master' of git://github.com/mihailges/moodle 2020-10-21 10:05:16 +08:00
Adrian Greeve
33831f6e21 Merge branch 'master-MDL-68284' of https://github.com/yao9394/moodle 2020-10-20 08:48:05 +08:00
Mihail Geshoski
e412f3029e MDL-69751 core: Restore deleted guest user and add missing context
This upgrade step fixes the cases where the current guest user is
labelled as 'deleted' and the related user context is missing.
2020-10-20 08:37:44 +08:00
Andrew Nicols
178e343a0f Merge branch 'MDL-69687-master' of https://github.com/sammarshallou/moodle 2020-10-20 08:01:51 +08:00
Paul Holden
fdd5aef039 MDL-69807 blocks: remove redundant sesskey loading edit/delete page. 2020-10-19 22:40:48 +01:00
Eloy Lafuente (stronk7)
4f3d5dfcb4 Merge branch 'MDL-69906-master-searchsimpledb' of git://github.com/mudrd8mz/moodle into master 2020-10-19 22:56:20 +02:00
Sara Arjona
d09980a8b0 Merge branch 'MDL-69897' of https://github.com/paulholden/moodle into master 2020-10-19 18:14:45 +02:00
sam marshall
4dcca1b084 MDL-69687 Course: remove_course_contents orphaned completion data
The remove_course_contents function did not delete data from
course_module_completion table in most cases, resulting in large
quantities of orphaned data.
2020-10-19 10:26:12 +01:00
Brendan Heywood
1b47d4bc0e MDL-69513 email: Add support for email DKIM signatures 2020-10-19 16:20:24 +11:00
sam marshall
2fe87d9566 MDL-69687 Course: Improve removal of completion data on MySQL 2020-10-16 18:20:23 +01:00
sam marshall
edb5cd0de4 MDL-69687 DB: Add API for deleting data based on subquery
The new API works on normal databases (by deleting data based on the
subquery) and also on MySQL (by deleting the data using a weird join
on the subquery).
2020-10-16 18:20:23 +01:00
Paul Holden
59ec5b1851 MDL-69788 lang: fallback to all translations if misconfigured.
If given translation list contains only invalid entries, fallback
to returning the complete list of available language translations.
2020-10-16 14:33:39 +01:00
Sagar Ghimire
a0ffd0de5f MDL-68284 gradebook: Prevent exposing hidden quiz grade item 2020-10-16 15:08:08 +11:00
Adrian Greeve
a83c69c2f5 Merge branch 'MDL-69549-master-7' of git://github.com/andrewnicols/moodle 2020-10-15 15:10:05 +08:00
Jun Pataleta
8252b24f95 Merge branch 'MDL-69520-master' of git://github.com/sarjona/moodle 2020-10-15 13:53:26 +08:00
Andrew Nicols
deb400c6bf MDL-69549 core: Add context export API 2020-10-15 13:45:58 +08:00
Sara Arjona
6171c4bbe8 MDL-69520 core_h5p: add example and tutorial links 2020-10-14 17:47:46 +02:00
Víctor Déniz
df61149804 Merge branch 'MDL-69779-better-x-redirect-by' of https://github.com/brendanheywood/moodle 2020-10-13 23:39:29 +01:00
Brendan Heywood
57aed80df6 MDL-68983 cache: Fix bug with readonly session combined with lock debug 2020-10-13 14:52:37 +11:00
Andrew Nicols
99ed3c3f1e Merge branch 'MDL-66928-request-dir-purge-bug' of https://github.com/brendanheywood/moodle 2020-10-13 11:48:41 +08:00
Brendan Heywood
9fabe1dda5 MDL-66928 core: Move request dirs to system tmp instead of localcache 2020-10-13 14:17:39 +11:00
Michael Milette
33c9499b28 MDL-68766 auth: Login form: 'Log in using...' should be h3, not h6 2020-10-12 10:40:22 -04:00
Jake Dallimore
502a5d8a74 Merge branch 'MDL-68292-admin-sesskey' of https://github.com/brendanheywood/moodle 2020-10-12 14:36:41 +08:00
Brendan Heywood
155b0da5a5 MDL-68292 core: Remove sesskey leakage on module pages 2020-10-12 17:10:03 +11:00
Adrian Greeve
095aecb555 Merge branch 'MDL-65743-master' of git://github.com/lameze/moodle 2020-10-12 13:39:16 +08:00
Andrew Nicols
0c21917931 Merge branch 'MDL-69776-master' of git://github.com/jleyva/moodle 2020-10-12 12:33:07 +08:00
Adrian Greeve
6fb8242e93 Merge branch 'MDL-69649-master' of git://github.com/rezaies/moodle 2020-10-12 10:14:53 +08:00
Jake Dallimore
18dc396fb2 Merge branch 'MDL-69707-redis-avoid-write' of https://github.com/brendanheywood/moodle 2020-10-12 09:57:15 +08:00
Brendan Heywood
16c209cbc0 MDL-69779 core: Improved the X-Redirect-By header when debugging is on 2020-10-11 09:48:12 +11:00
Paul Holden
96ec6ee826 MDL-69825 admin: externalpage class using a callback for access check.
Co-Authored-By: Marina Glancy <marina@moodle.com>
2020-10-09 15:09:09 +01:00
David Mudrák
b295a88821 MDL-69906 admin: Display Setup search engine as link only if it is valid
We use auto-generated admin section name here so we need to check that
the target section actually exists.
2020-10-09 14:16:37 +02:00
Jun Pataleta
b68708059f Merge branch 'MDL-69740' of https://github.com/timhunt/moodle 2020-10-09 11:56:54 +08:00
Paul Holden
9cbce6858f MDL-69897 repository: add heading to delete file modal. 2020-10-08 20:28:40 +01:00
Andrew Nicols
f908e8beef MDL-69192 mod_assign: Stop clicking OK on non-existent modal 2020-10-08 08:04:10 +08:00
Eloy Lafuente (stronk7)
753bda3d58 Merge branch 'MDL-69760-master' of https://github.com/inkjet2000/moodle into master 2020-10-08 00:23:47 +02:00
Justin Merrill
b80d65e45a MDL-69760 core: add mdl_event index for assign adhoc tasks 2020-10-07 10:35:57 -04:00
Adrian Greeve
c935f3bae0 Merge branch 'MDL-59510-master' of https://github.com/snake/moodle 2020-10-07 10:02:19 +08:00