Commit graph

78 commits

Author SHA1 Message Date
Shamim Rezaie
dacfebedf3 Merge branch 'MDL-73348' of https://github.com/stronk7/moodle 2021-12-22 21:19:52 +11:00
Jun Pataleta
e9bd499fb1 Merge branch 'MDL-72867-master' of https://github.com/HuongNV13/moodle 2021-12-21 11:23:09 +08:00
Eloy Lafuente (stronk7)
e4a2d9c1d4 MDL-73348 phpunit: normalize all privacy provider tests
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
  privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)

Also, change some relative paths and comments to point to new
locations.
2021-12-17 14:21:02 +01:00
Eloy Lafuente (stronk7)
57e6fb7ad9 MDL-73348 phpunit: privacy and privacy_provider testcase names
All privacy_test and privacy_provider_test classes:

- Namespaced with component\privacy.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Renamed a few files to make all be privacy_test or privacy_provider_test.php
- All them passing individually.
- Complete runs passing too.
2021-12-17 14:21:02 +01:00
Huong Nguyen
8c336899a9 MDL-72867 Navigations: User menu improvements 2021-12-15 13:54:45 +07:00
Ilya Tregubov
6f44f008d8 Merge branch 'MDL-73278' of https://github.com/stronk7/moodle 2021-12-10 18:51:40 +02: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
Eloy Lafuente (stronk7)
deb0e76eee MDL-73278 phpunit: Rename already namespaced classes to match file name
These are the only cases 100% safe to apply the renaming of the
testcase class names to match the file names.

All other cases are not safe, because they are missing namespace
and may enter into name conflicts. Adding namespaces is not as
simple as imagined because it implies to, also, add a good number
of modifications to core. See the issue for more details.
2021-12-07 23:54:29 +01:00
Mathew May
f65b92577a MDL-70197 navigation: Update classic goutte tests 2021-11-30 08:13:49 +02:00
Mathew May
b983003e2e MDL-70197 navigation: Remove old navigation elements and migrate behat 2021-11-29 15:47:42 +08:00
Amaia Anabitarte
1d4edcb57b MDL-72099 core_contenbank: Add context navigation 2021-10-14 13:04:13 +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
Sara Arjona
39fa45e299 MDL-69331 core_contentbank: Hide disabled H5P content-types
If a H5P content-type is disabled:
- The content bank won't display existing contents having it as a
main library.
- The content bank won't allow to create new contents using it.
2021-04-15 09:16:32 +02:00
Amaia Anabitarte
33fed53ad9 MDL-71107 core_contentbank: Behat test. Authoring when copying a course 2021-04-07 10:03:38 +02:00
Eloy Lafuente (stronk7)
81407f18ec MDL-71036 phpunit: Mock->setMethods() silently deprecated
The current ->setMethods() has been silently (won't emit any
warning) in PHPUnit 9. And will stop working (current plans)
in PHPUnit 10.

Basically the now deprecated method has been split into:

- onlyMethods(): To point to existing methods in the mocked artifact.
- addMethods(): To point to non existing (yet) methods in the mocked
  artifact.

In practice that means that all our current setMethods() calls can be
converted to onlyMethods() (existing) and done. The addMethods() is
mostly useful on development phases, not final testing.

Finally note that <null> isn't accepted anymore as parameter to
double all the methods. Instead empty array [] must be used.

Link: https://github.com/sebastianbergmann/phpunit/issues/3770
2021-03-11 23:04:31 +01:00
Eloy Lafuente (stronk7)
8a14a7bd22 MDL-71036 phpunit: assertContains() now performs strict comparison
The methods assertContains() and assertNotContains() now perform
strict (type and value) comparison, pretty much like assertSame()
does.

A couple of new assertContainsEquals() and assertNotContainsEquals()
methods have been created to provide old (non-strict) behavior, pretty
much like assertEquals() do.

Apart from replacing the calls needing a relaxed comparison to those
new methods, there are also a couple of alternative, about how to
fix this, depending of every case:

- If the test is making any array_values() conversion, then it's better
  to remove that conversion and use assertArrayHasKey(), that is not
  strict.
- Sometimes if may be also possible to, simply, cast the expectation
  to the exact type coming in the array. I've not applied this technique
  to any of the cases in core.

Link: https://github.com/sebastianbergmann/phpunit/issues/3426
2021-03-11 23:04:31 +01:00
Eloy Lafuente (stronk7)
90db228323 Merge branch 'MDL-70726-master' of https://github.com/NashTechOpenUniversity/moodle 2021-03-11 00:11:15 +01:00
Amaia Anabitarte
d0bea8aa5e 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:19:55 +07:00
David Matamoros
9b8c45e0d6 MDL-70941 contentbank: fix empty equality check when renaming content 2021-02-26 11:50:09 +01:00
François Moreau
3776fbafb2 MDL-69762 core_contentbank: let users hide their content 2021-02-15 13:26:32 -05:00
Sara Arjona
c7a7fdab25 MDL-70438 contentbank: fix behat issue with classic 2021-01-20 17:36:36 +01:00
Sara Arjona
3810b293ad MDL-70438 contentbank: Add column to view mode for content uses 2021-01-19 16:08:03 +01:00
Sara Arjona
deeadc98d6 MDL-70438 contentbank: Display content uses before removal 2021-01-19 16:08:03 +01:00
Sara Arjona
890d0690d4 MDL-70438 contentbank: Add method get_uses to content 2021-01-19 08:21:30 +01: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
Amaia Anabitarte
97c0fa7286 MDL-69672 core_contentbank: is_context_allowed unit tests 2020-09-29 17:46:11 +02:00
Andrew Nicols
805cca26fd Merge branch 'MDL-69270-master' of git://github.com/ferranrecio/moodle 2020-09-01 07:26:02 +08:00
Sara Arjona
66455e02d8 MDL-69269 contentbank: add support to download content 2020-08-28 12:28:13 +02:00
Ferran Recio
c5a8469abb MDL-69270 contentbank: replace content with file 2020-08-26 12:36:27 +02:00
Andrew Nicols
f8e916d705 Merge branch 'MDL-68975-master' of git://github.com/sarjona/moodle 2020-08-20 08:40:37 +08:00
Amaia Anabitarte
dfd8f6b56e MDL-69089 core_contentbank: Tests for empty content names 2020-08-17 15:54:36 +02:00
Sara Arjona
15381c0b33 MDL-68975 contentbank: add author field to file details view 2020-08-13 19:10:15 +02:00
Ferran Recio
5132309170 MDL-69143 contentbank: catching Exception on file upload 2020-08-12 16:57:17 +02:00
Ferran Recio
910755acf5 MDL-69143 contentbank: fix tests when extra plugins installed 2020-07-29 17:49:50 +02:00
Ferran Recio
3dfbd5a16f MDL-69143 contentbank: add import file method to content 2020-07-29 17:49:50 +02:00
Amaia Anabitarte
7be38070d4 MDL-68936 core_contentbank: Behat test for editing capabilities 2020-06-08 16:40:10 +02:00
Sara Arjona
4106d26354 Merge branch 'MDL-68796-master' of git://github.com/bmbrands/moodle 2020-06-03 14:26:53 +02:00
Amaia Anabitarte
45bff7f9d6 MDL-68578 contenttype_h5p: Behat test for H5P editor changes 2020-06-02 16:17:22 +02:00
Víctor Déniz Falcón
db1fb23ce2 Merge branch 'MDL-67813-master-1' of git://github.com/mihailges/moodle 2020-05-28 13:00:16 +01:00
Eloy Lafuente (stronk7)
6f56e743ed Merge branch 'MDL-68753-master-enfix' of git://github.com/mudrd8mz/moodle 2020-05-28 13:01:39 +02:00
Mihail Geshoski
1bb6231b32 MDL-67813 core_contentbank: Add content name parameter in the generator 2020-05-28 12:06:31 +08:00
Bas Brands
c393d8185a MDL-68796 core_contentbank: Store view preferences
includes privacy export, privacy unit test
2020-05-27 17:27:23 +02:00
Víctor Déniz Falcón
c49d8663ad MDL-67810 core_contentbank: contenttype_h5p editor integrated 2020-05-27 10:27:55 +01:00
Víctor Déniz Falcón
75f58cbfa2 MDL-67810 core_contentbank: added dropdown menu to create content 2020-05-27 10:27:13 +01:00
David Mudrák
c47b174d44 MDL-68753 lang: Use the updated strings in the tests 2020-05-27 09:59:35 +02:00
Andrew Nicols
ae2e417a19 Merge branch 'MDL-68493-master' of git://github.com/bmbrands/moodle 2020-05-22 09:04:57 +08:00
Amaia Anabitarte
8675e8ae6a MDL-68782 core_contentbank: Improving event unit tests 2020-05-20 22:37:30 +02:00
Bas Brands
e695d9d0b6 MDL-68493 core_contentbank: implement list view 2020-05-20 16:27:58 +02:00