27838 Commits

Author SHA1 Message Date
Jake Dallimore
62e5852f36 Merge branch 'MDL-70010' of https://github.com/stronk7/moodle 2020-10-28 11:07:19 +08:00
Eloy Lafuente (stronk7)
f9faf700aa NOBUG: Fixed file access permissions 2020-10-27 23:47:26 +01:00
Matt Clarkson
541e90c32c MDL-68722 atto_equation: fix for form elements with special characters
Element id's containing characters such as ':' would break the tab
selector in bootstrap.

This specifically affects the essay question type.
2020-10-28 09:26:43 +13:00
Andrew Nicols
d5be288740 MDL-69166 core: Fix upgrade step savepoint 2020-10-27 13:12:59 +08:00
Andrew Nicols
931f36ce15 Merge branch 'MDL-69166-master-4' of git://github.com/rezaies/moodle 2020-10-27 12:47:50 +08:00
Shamim Rezaie
d5a9d6e520 MDL-69166 core_payment: Rename componentid to itemid 2020-10-27 15:34:56 +11:00
Shamim Rezaie
2d7feb7583 MDL-69166 core_payment: Renamed plugintype name from pg to paygw 2020-10-27 15:34:55 +11:00
Marina Glancy
71ccaf200d MDL-69166 core_payment: rename some functions 2020-10-27 15:34:55 +11:00
Shamim Rezaie
410973cf10 MDL-69166 Replace all upgrade steps with just "create_table" steps 2020-10-27 15:34:54 +11:00
Shamim Rezaie
61766b3d11 MDL-69166 core_payment: Add paymentarea to the payment subsystem 2020-10-27 14:40:49 +11:00
Marina Glancy
409857a42f MDL-69166 core_payment: archiving accounts, triggering events, tests 2020-10-27 14:40:49 +11:00
Marina Glancy
6ff3087fe6 MDL-69166 core_payment: add payment accounts 2020-10-27 14:40:49 +11:00
Marina Glancy
7740c45de4 MDL-69166 core_form: allow modals to prevent closing on accidental click 2020-10-27 14:37:28 +11:00
Shamim Rezaie
52ed1392f8 MDL-69166 core_payment: Save general payment information 2020-10-27 14:37:28 +11:00
Michael Hawkins
2660d542c8 MDL-69559 core: Removed stopPropagation from tree click handling
It was preventing JS click event handlers being reached on some
elements, such as course admin items in Classic
(eg download course content for teachers).
2020-10-27 07:52:43 +08:00
Sara Arjona
c7d9b12994 MDL-65959 core_badges: fix unique index in upgrade.php
There was an error when creating the unique index. Apart from that,
the code has been reorganised to copy data in the new structure only
if password field hasn't been removed.
2020-10-26 23:56:04 +01:00
Sara Arjona
5deb0dad76 Merge branch 'MDL-65959-master' of git://github.com/peterRd/moodle 2020-10-26 22:39:28 +01:00
Shamim Rezaie
9f2d8a0bdc MDL-69166 core_payment: WS to get list of gateways supporting a currency 2020-10-27 08:37:08 +11:00
Shamim Rezaie
a580b33738 MDL-69166 enrol_fee: An enrolment plugin that supports payments 2020-10-27 08:37:08 +11:00
Shamim Rezaie
a5d219b811 MDL-69166 pg_paypal: A new payment gateway is born 2020-10-27 08:37:08 +11:00
Shamim Rezaie
e52362fc5c MDL-69166 core_payment: basic gateway skeleton 2020-10-27 08:37:08 +11:00
Shamim Rezaie
9d77bf7c9b MDL-69166 core: define payment as a subsystem and pg as a plugin type 2020-10-27 08:37:08 +11:00
Peter Dias
d3af959238 MDL-65959 badge: Enable OB2.1 *connection* with cross domain ability 2020-10-27 00:27:20 +08:00
Peter Dias
96ec45cb17 MDL-65959 badges: Do not use badge user preference after verification 2020-10-27 00:27:19 +08:00
Peter Dias
3cae9421a8 MDL-65959 badges: Update the implementation to use admin set backpack 2020-10-27 00:27:19 +08:00
Peter
b6435e0934 MDL-65959 core_badges: Allow ability to upload badges cross domain. 2020-10-27 00:27:18 +08:00
Eloy Lafuente (stronk7)
0dbeb9748b MDL-70010 core: reconcile MOODLE_310_STABLE and master
There are some unexpected differences between 310 and master,
better reconcile them now. Note this is not 100% critical but,
as far as nothing exclusively for 4.0 has landed to master yet
only branch/version differences should exist.
2020-10-26 10:48:53 +01:00
Eloy Lafuente (stronk7)
3dcb4f549f Merge branch 'MDL-69993' of git://github.com/paulholden/moodle into master 2020-10-26 10:42:31 +01:00
Michael Hawkins
840bcd8810 MDL-69559 course: Add course setting and cap to control course downloads 2020-10-26 10:00:47 +08:00
Michael Hawkins
d661b1148b MDL-69559 course: Add course content download UI and execution page 2020-10-26 10:00:47 +08:00
Michael Hawkins
eb54686500 MDL-69559 course: Add capability and access checks for course download 2020-10-26 10:00:47 +08:00
Peter
1c4620bce6 MDL-65959 core_badges: Unrestricted user's badger account
* Restructure the email to be backpack specific
* Amended table defintion and functions
2020-10-25 23:03:59 +08:00
Paul Holden
b14cca8a24 MDL-69993 output: correct navigation node type for user reports. 2020-10-23 08:04:44 +01:00
Adrian Greeve
295a1e3bee Merge branch 'MDL-67650-forced-checkbox-textarea' of https://github.com/brendanheywood/moodle 2020-10-23 09:03:20 +08:00
Sara Arjona
6d6f30f298 Merge branch 'MDL-69553' of https://github.com/NeillM/moodle 2020-10-22 08:55:55 +02:00
Brendan Heywood
0f3fdc1133 MDL-67650 admin: Consistently show forced config settings 2020-10-22 13:16:51 +11:00
Adrian Greeve
a9ab6a1db7 Merge branch 'MDL-69788' of https://github.com/paulholden/moodle 2020-10-22 09:08:50 +08:00
Eloy Lafuente (stronk7)
284d0ae8f8 Merge branch 'MDL-66392' of https://github.com/paulholden/moodle into master 2020-10-21 19:43:13 +02:00
Paul Holden
cecd90ffec MDL-66392 analytics: make model output directory default to empty.
Falling back to path within $CFG->dataroot/models.
2020-10-21 18:04:26 +01:00
Sara Arjona
a3039fd1d4 Merge branch 'm40_MDL-68536_Notice_Undefined_Property_CFG_branch' of https://github.com/scara/moodle into master 2020-10-21 18:32:38 +02:00
Sara Arjona
ca2db4be71 Merge branch 'MDL-67673' of https://github.com/stronk7/moodle into master 2020-10-21 17:38:05 +02:00
Víctor Déniz
3e6892af4b Merge branch 'MDL-69513-dkim-settings' of https://github.com/brendanheywood/moodle 2020-10-21 11:57:11 +01:00
Eloy Lafuente (stronk7)
07c1522d88 MDL-67673 phpunit: Document all the changes in upgrade.txt
This includes:

- Breaking changes (return void + PHP 7.1 min requirement).
- Deprecations and removals.
- Specifically DbUnit and its replacement.
- Printer showing how to rerun tests removed.
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
cc1c4de8dc MDL-67673 phpunit: Remove the rerun hint on failed test cases
That custom printer was using some hacks to be able to intercept
configuration switches, reflection and other tricks to be able to
print the:

To re-run:
 vendor/bin/phpunit --verbose "core_setuplib_testcase" lib/tests/setuplib_test.php

line on every failed/exceptional/skipped test. After some internal
discussion it was agreed that the normal phpunit output:

1) core_setuplib_testcase::test_localcachedir
Time is lower that allowed start value
Failed asserting that 1601976686 is equal to 1601976687 or is greater than 1601976687.

/var/www/html/lib/phpunit/classes/advanced_testcase.php:446
/var/www/html/lib/tests/setuplib_test.php:170
/var/www/html/lib/phpunit/classes/advanced_testcase.php:80

has already all the information at hand about how to rerun a test:

- vendor/bin/phpunit lib/tests/setuplib_test.php
- vendor/bin/phpunit --filter core_setuplib_testcase::test_localcachedir
- vendor/bin/phpunit --filter ::test_localcachedir
- vendor/bin/phpunit --testsuite componentname_testsuite
- vendor/bin/phpunit --config <<compoenent directory>>
- use --cache-result to get failed tests rerun with ease.
- ...

So better, let's use standard phpunit output and done. Also, note that,
with the upgrade to phpunit 8.5, the printer was not working correctly
any more, causing some switches, like --verbose ... to be ignored. Sure
it could have been fixed but, as commented above, no real need for all
that "parapheranlia" to print the rerun information.
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
447316a9f6 MDL-67673 phpunit: deprecate old phpunit/dbunit stuff
Apply the standard deprecation procedure to the old APIs, to
be removed in Moodle 4.2 (MDL-69882). Existing unit tests
cover the deprecation debugging.

Originally MDL-64600
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
8183def69e MDL-67673 phpunit: Move tests to use new phpunit_dataset
- Make advanced_testcase old methods to use new ones internally.
- Fix advanced_testcase, statslib, mod/quiz and mod/data tests.

Originally MDL-64600
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
ed103545dd MDL-67673 phpunit: Introduce a new, lightweight phpunit_dataset
In charge of taking over the, now removed/archived, phpunit/dbunit
package. It supports loading of CSV/XML files and strings and
PHP arrays, allowing to send the loaded information to database.

Perform some basic controls about the consistency of information,
surely not super-exhaustive but fair enough.

100% covered with unit test.

Planned like an "interim" replacement for phpunit/dbunit uses in
core that, ideally, should be moved to generators stuff at some
point.

Note, expect a few tests in core to fail with this commit, I've
changed some fixtures around. Next commit will fix existing uses.

Originally MDL-64600
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
3a5641cb74 MDL-67673 phpunit: Remove deprecated assertEquals() params
The optional parameters of assertEquals() and assertNotEquals()
are deprecated in PHPUnit 8 (to be removed in PHPUnit 9):

- delta => use assertEqualsWithDelta()
- canonicalize => use assertEqualsCanonicalizing()
- ignoreCase => use assertEqualsIgnoringCase
- maxDepth => removed without replacement.

More info @ https://github.com/sebastianbergmann/phpunit/issues/3341

Initial search done with:

ag 'assert(Not)?Equals\(.*,.*,' --php

Then, running tests and fixing remaining cases.
2020-10-21 12:46:00 +02:00
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