Commit graph

727 commits

Author SHA1 Message Date
sam marshall
b5568aad80 MDL-70102 PHPunit: Core test fails with weird added modules
Specifically it fails if the modules have unusual default capabilities
so that editingteacher doesn't have addinstance.
2021-01-07 16:09:57 +00:00
Andrew Nicols
31402aa406 MDL-69107 user: Fix autocomplete usages 2020-12-16 07:50:56 +08:00
Andrew Nicols
0d580d2b3e MDL-67668 behat: Update tests for inplace editable field type 2020-11-23 09:01:19 +08:00
Andrew Nicols
ba34d6e225 MDL-70148 behat: Update steps for keyboard 2020-11-17 15:14:43 +08:00
Marina Glancy
7fb6ce765f MDL-70023 core_course: improve performance of recently accessed courses 2020-11-05 09:56:01 +01:00
Michael Hawkins
c2b115f829 MDL-69559 course: Fixed behat navigation in download course content 2020-10-27 07:52:18 +08:00
Adrian Greeve
e1eba7fa9b MDL-69559 core_course: Fix to bad behat test formatting. 2020-10-26 13:24:12 +08:00
Michael Hawkins
840bcd8810 MDL-69559 course: Add course setting and cap to control course downloads 2020-10-26 10:00:47 +08: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
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)
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
Sara Arjona
f25dba2de1 Merge branch 'MDL-64657-master' of git://github.com/jleyva/moodle into master 2020-10-08 14:15:26 +02:00
Paul Holden
d178779851 MDL-69625 course: return raw custom field value in external method.
For clients that wish to consume the original value of the custom
field (e.g. timestamps for date fields), rather than the formatted
version, add a new "valueraw" property to the returned data.
2020-10-05 10:39:31 +01:00
Sara Arjona
8223718081 Merge branch 'MDL-68935-master' of git://github.com/jleyva/moodle into master 2020-09-28 11:40:37 +02:00
Juan Leyva
d6c289c5e3 MDL-64657 course: Return hidden section names when configured 2020-09-22 11:52:18 +02:00
Bas Brands
d5593b18c2 MDL-69454 core_search: consistent course management search 2020-09-21 10:15:11 +02:00
Juan Leyva
35101a6a2c MDL-68935 course: Return context data in get_content WS 2020-09-16 12:32:22 +02:00
Sara Arjona
cf4841cfdb Merge branch '67278-master-categories-selector' of https://github.com/DSI-Universite-Rennes2/moodle into master 2020-09-02 17:37:15 +02:00
Julien Boulen
93d7220587 MDL-67278 course: Use autocomplete widget for course category selector 2020-09-02 15:30:34 +02:00
Paul Holden
ad7d46ed2e MDL-63387 course: use renamed role names, update Behat tests.
Specify that we want both role names (renamed course role plus
original).
2020-09-01 12:05:20 +01:00
Paul Holden
9dbb05ffe0 MDL-60260 course: validate external fields on create/update course.
Ensure course fullname/shortname fields are not empty.
2020-07-29 19:57:16 +01:00
Mihail Geshoski
2b61f1eb27 MDL-69206 course: Tidy up behat test to avoid potential failures 2020-07-14 12:09:52 +08:00
Mihail Geshoski
586ae77bc2 MDL-69206 course: Tidy up unit test to avoid potential failures 2020-07-14 12:09:52 +08:00
Peter Dias
c8388ead0f MDL-69065 course: Provide the id for the sr param
* Pass the section return id to the activity chooser
* Additional behat test to cover the case
2020-06-23 13:19:07 +08:00
Marina Glancy
8eaad10b5f MDL-68998 core_course: do not expect that assign is the first module 2020-06-09 18:59:34 +02:00
Jun Pataleta
618b13e1f5 Merge branch 'MDL-67883-squash' of https://github.com/Chocolate-lightning/moodle 2020-06-05 11:52:36 +08:00
Mathew May
16d77f1884 MDL-67883 core: Make core ready for MoodleNet. 2020-06-05 11:47:42 +08:00
Michael Hawkins
5187e7c515 MDL-68612 core: Behat tests updated to support new participants filter
Existing tests have been updated, rewritten and/or expanded to support
the new participants filter.
2020-06-03 14:29:22 +08:00
Sara Arjona
582481c3e9 MDL-68583 core_course: add missing spaces 2020-05-28 17:57:26 +02:00
Sara Arjona
f27e579cdd Merge branch 'MDL-68583-master' of https://github.com/kabalin/moodle 2020-05-28 17:42:52 +02:00
Víctor Déniz Falcón
37f2c91a8c Merge branch 'MDL-68209-master-2' of git://github.com/bmbrands/moodle 2020-05-28 16:37:21 +01:00
Ruslan Kabalin
4993775900 MDL-68583 core_course: Fix category delete action menu.
Deletion form offers user a deletion with contents move option, it is
available when full deletion is not permitted. Action menu should take
this into account too and allow user to reach the form.
2020-05-28 14:30:04 +01:00
Bas Brands
5fe7bcdb30 MDL-68209 core_course: improve activity chooser styling 2020-05-27 16:49:23 +02:00
Bas Brands
91de0ed823 MDL-67874 theme_boost: make focus outline accessible 2020-05-26 09:54:12 +02:00
Adrian Greeve
b2978c1787 Merge branch 'MDL-68757' of https://github.com/timhunt/moodle 2020-05-26 10:33:03 +08:00
Andrew Nicols
ecf526566a Merge branch 'MDL-64427' of https://github.com/NeillM/moodle 2020-05-26 10:04:51 +08:00
Andrew Nicols
e1657e3c07 Merge branch 'MDL-68661-rebase' of https://github.com/Chocolate-lightning/moodle 2020-05-22 11:12:46 +08:00
Mathew May
7f86455237 MDL-68661 core_lang: Roll back addresourceoractivity 2020-05-22 10:02:57 +08:00
Adrian Greeve
56287073d5 Merge branch 'MDL-68662' of https://github.com/Chocolate-lightning/moodle 2020-05-20 16:52:17 +08:00
Mathew May
e146a2ca74 MDL-68662 core_course: Add new tabs to the chooser
We now have two more tabs in the chooser.
Activities & Resources aer now offered in different tabs.
2020-05-20 15:53:06 +08:00
Neill Magill
236a52c4de MDL-64427 category: Test getting category courses during deletion
Adding a unit test for the situation where a course is partially
deleted when a list of courses in a category is retrived.
2020-05-20 08:27:52 +01:00
Adrian Greeve
59d0090fda Merge branch 'MDL-67548-master' of https://github.com/kabalin/moodle 2020-05-20 08:35:18 +08:00
Tim Hunt
4a45b7112c MDL-68757 questions: don't do output in low-level functions 2020-05-18 20:54:27 +01:00
Adrian Greeve
a1bd5d556d Merge branch 'MDL-68563-master' of git://github.com/lameze/moodle 2020-05-18 11:34:38 +08:00
Matt Porritt
01436f7539 MDL-64843 Backup: Course copy user interface
This patch adds better core support for copying courses.
There is now a simplified and dedicated UI for copying
courses. This can be accessed from the course context
menu or course management screens.

All backups are done asynchronously and there can be multiple
copies of a course in flight at once.
2020-05-15 06:02:02 +00:00
Ruslan Kabalin
a38e1d4968 MDL-67548 core_course: Add unittests covering category deletion hooks. 2020-05-13 10:24:33 +01:00
David Mudrák
87f9e88ddd MDL-68563 filters: Fix unit test regressions
Also incrementing the plugin versions to make sure the unit test
environment is reinitialised and the tests are reliable.

Minor correction of phpdocs @package tags included.
2020-05-13 16:28:24 +08:00
Andrew Nicols
7afd16ad84 MDL-66109 behat: Require newline at EOF
This change enables the gherkinlint rule to require a new line at the
end of the file. This change is in keeping with existing Moodle coding
style guidelines.
2020-05-11 11:07:49 +08:00