514 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
870a8de3fb MDL-37655 phpunit: Avoid having multiple testcase classes in 1 file
Note that there wasn't any case of multiple testcase classes in
1 file. All the cases reported in the issue were false positives
caused but other "mock/fixture" files being named _test.

So all this issue does is:

1) rename any _test suffixed class in test files, because we are
   going to start renaming a lot of test classes to _test.

2) ensure that the 2 test case classes modified in this issue,
   are already observing the filename = classname rule that will
   be implemented soon (and verigy it works).
2021-03-30 19:17:54 +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
Andrew Nicols
a84a55bd45 MDL-64554 user: Fix use of Private files page on classic
The "Private files" link does not exist in the site navigation when
using the classic theme, so it is not possible to test the dedicated
page via Behat at this time.
2021-02-19 09:33:06 +08:00
Marina Glancy
440073ff20 MDL-64554 user: make private files editor modal/ajax form 2021-02-17 18:06:57 +01:00
Juan Leyva
7f02879ce7 MDL-70387 files: New WS core_files_get_unused_draft_itemid 2021-01-13 13:01:40 +01:00
Mark Nelson
38cd9a6bd7 MDL-68533 core_files: add archive_writer API 2020-12-12 12:44:55 +08: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
Juan Leyva
94a0ee41e7 MDL-69776 files: New WS core_files_delete_draft_files 2020-09-25 10:37:16 +02:00
Eloy Lafuente (stronk7)
fbb0767536 MDL-69475 versions: bump all versions and requires in master
version = 2021052500 release version
requires= 2021052500 same than version

Why 20210525? (25th May 2021) ?

Because master is going to be Moodle 4.0, to be released
on November 2021. And, until then, we are going to have
a couple of "intermediate" releases:

- Moodle 3.10 to be released 9th November 2020. (2020110900)

  This version will be using versions from today to 2020110900
  (once it's released the YYYYMMDD part stops advancing).

- Moodle 3.11 to be released 10th May 2021. (2021051000)

  This version will be using versions from 3.10 release to 2021051000
  (once it's released the YYYYMMDD part stops advancing).

That means that all versions from today to 2021051000 are going
to be used by those 2 "intermediate" releases (3.10 and 3.11).

And we cannot use them in master, because it's forbidden to have
any overlapping of versions between branches (or different upgrade
paths will fail).

So, get that 2021051000, let's add it a couple of weeks to cover
the on-sync period (or a 2 weeks delay max!) and, the first version
that master can "own" in exclusive (without any overlap) is, exactly,
25th May 2021, hence our 20210525.
2020-08-18 00:47:15 +02:00
Eloy Lafuente (stronk7)
115cc0214f MDL-68973 versions: bump all versions and requires near release
version = 2020061500 release version
requires= 2020060900 current rc1 (week7roll1) version
2020-06-09 16:23:09 +02:00
David Mudrák
6918ca6a4e MDL-68888 lang: Use the fixed spelling in the Behat tests, too 2020-06-05 09:33:29 +02:00
Jun Pataleta
1389465c29 MDL-66911 files: Use proper function for fetching enabled licenses 2020-05-28 15:23:38 +08:00
Adrian Greeve
4231b83668 Merge branch 'MDL-66911-38_core_file_add_license_help_to_fileselect' of https://github.com/tomdickman/moodle 2020-05-28 09:09:27 +08:00
Tom Dickman
2228ca31a2 MDL-66911 core files: Add license help to file selector
This improvement adds a help icon to the 'Choose license' option
providing links to further information on each license.
Utilise templates for license links to avoid code reuse.
2020-05-27 08:36:48 +10:00
Bas Brands
91de0ed823 MDL-67874 theme_boost: make focus outline accessible 2020-05-26 09:54:12 +02:00
Mihail Geshoski
17ddce9676 MDL-60817 core_repository: Show a warning if file extension is modified 2020-03-13 13:17:44 +08:00
Peter Dias
06dc3a6c27 MDL-33671 core: Remove custom behat selectors
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2020-03-04 13:38:49 +08:00
Peter
a216d86c6c MDL-33671 core: Add ability to download selected items
Utilise the new checkbox-toggleall functionality
2020-03-03 07:20:35 +08:00
Peter
2f03923602 MDL-33671 core: Allow for bulk delete of files
* Enable bulk delete in a details view
* Behat tests for new functionality
* Unit test for new function
2020-03-03 07:20:35 +08:00
Zig Tan
1395442474 MDL-54554 files: Improve unoconv error logging & sanity checks 2019-12-16 09:52:51 +08:00
Eloy Lafuente (stronk7)
d5be859063 MDL-67199 versions: bump all versions and requires near release
version = 2019111800 release version
requires= 2019111200 current beta (week7roll1) version
2019-11-12 17:57:08 +01:00
Ryan Wyllie
e81be9a8b1 MDL-64821 files: increase icon image size for stored file exporter
The default size for the stored file icon was only 16px by 16px which
wasn't suitable for display in the new forum layout. I've increased
the default size to 128px by 128px so that it looks better scaled up.
2019-09-25 10:42:19 +08:00
Andrew Nicols
201c689b20 Merge branch 'MDL-59911-conv_cleanup_check' of git://github.com/leonstr/moodle 2019-07-18 08:25:07 +08:00
Leon Stringer
50960244d8 MDL-59911 fileconverter_unoconv: Fix: test PDF fails after upgrade
When generating the PDF of unoconv_test.docx this file's previous conversions
are removed from mdl_file_conversion.  But these may also be removed by
\core_files\task\conversion_cleanup_task in which case an error occurs as
delete() is invoked with a NULL id.  Added check for non-NULL id prior to
invoking delete().
2019-07-16 16:44:09 +01:00
Damyon Wiese
27b67f6b5a MDL-65409 files: Allow location header
Allow incorrect capitals in location header response.
2019-07-12 08:42:20 +08:00
Eloy Lafuente (stronk7)
c9a1a6341c MDL-65571 versions: bump all versions and requires near release
version = 2019052000 release version
requires= 2019051100 current beta (week6roll2) version
2019-05-12 23:46:34 +02:00
Ryan Wyllie
a307a47651 MDL-64820 external: add isimage to stored_file exporter 2019-03-22 09:24:04 +08:00
Jun Pataleta
ed90e4d378 MDL-64230 files: Display long file/folder names with ellipsis
* Instead of clipping long file/folder names by default, truncate them
with ellipsis to indicate to the user that the file/folder has a long
name.
2019-03-08 14:48:49 +08:00
Mathew May
f39111d0ea MDL-58428 renderer: Move renderer override from files 2019-02-26 16:24:49 +08:00
Helen Foster
65d70aa81b MDL-64509 lang: Import fixed English strings (en_fix)
Significant string change: enablerunnow_desc,tool_task - including
mention of pathtophp requirement
2019-01-07 14:40:34 +01:00
Eloy Lafuente (stronk7)
085353b315 MDL-64282 versions: bump all versions and requires near release
version = 2018120300 release version
requires= 2018112800 current rc2 (week7roll1) version
2018-11-29 18:24:08 +01:00
Andrew Nicols
c96cd71102 MDL-63924 privacy: Add shared user providers to subsytsems 2018-11-08 21:26:18 +08:00
Andrew Nicols
b272efb460 Merge branch 'MDL-63673-master' of git://github.com/mihailges/moodle 2018-10-26 11:40:46 +08:00
Mihail Geshoski
8171cd7f3c MDL-63673 fileconverter_googledrive: Support removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-24 07:02:16 +08:00
Andrew Nicols
4b3ca0ebf2 MDL-63657 core_files: Coding style fix 2018-10-23 11:26:02 +08:00
Andrew Nicols
2612cf5673 Merge branch 'MDL-63640-master' of git://github.com/mihailges/moodle 2018-10-23 11:25:21 +08:00
Mihail Geshoski
16ec426a4f MDL-63640 core_files: Add method that returns users in context
This issue is part of the MDL-62560 Epic.
2018-10-23 10:48:12 +08:00
Mihail Geshoski
1ba1fcf838 MDL-63639 core_fileconverter: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 12:50:11 +02:00
Víctor Déniz Falcón
02fda279ed MDL-57281 behat: deprecated step definition I navigate to node in
Definition step deprecated and affected tests modified.
2018-08-20 12:53:26 +01:00
Andrew Nicols
4a74ab0200 MDL-36754 core_files: Add a token version of pluginfile 2018-08-14 06:57:32 +08:00
Eloy Lafuente (stronk7)
57ea6753d3 MDL-62361 versions: bump all versions and requires near release
version = 2018051400 release version
requires= 2018050800 current beta+ (week4roll1) version
2018-05-09 02:46:30 +02:00
Andrew Nicols
2203ef4f74 Merge branch 'MDL-62235-master' of git://github.com/FMCorz/moodle 2018-04-30 13:57:48 +08:00
Frédéric Massart
c9f95d296a MDL-62235 core_files: Implement privacy API 2018-04-30 13:41:20 +08:00
Frédéric Massart
790c89b34d MDL-62208 core_fileconverter: Implement privacy API 2018-04-26 12:54:01 +08:00
Mihail Geshoski
700029fca5 MDL-61878 fileconverter_googledrive: Add privacy files and unit tests 2018-04-19 13:16:21 +08:00
Mihail Geshoski
10268ec52e MDL-61867 fileconverter_unoconv: Add privacy files 2018-04-09 11:41:21 +08:00
Adrian Greeve
5aeadf0b7b MDL-61127 filepicker: Added aria-selected attribute to repos.
The repository list in the file picker now as aria-selected
added to denote which repository is selected.
2018-04-03 16:25:40 +08:00
Jake Dallimore
46878ed87f MDL-58272 core_files: get converters from file extension not mimetype 2017-12-08 09:07:29 +08:00
Eloy Lafuente (stronk7)
ba854606e6 MDL-60764 versions: bump all versions and requires near release
version = 2017111300 release version
requires= 2017110800 current rc2 version
2017-11-10 02:52:53 +01:00