1957 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
511801cb46 MDL-73352 phpunit: lib_test and locallib_test testcase names
All lib_test and locallib_test classes:

- Namespaced with component (and API whenever makes sense).
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed or add new uses.
- All them passing individually.
- Complete runs passing too.

Special mention to tests under login/tests:

1) The core_login component doesn't exist.
2) But login/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have login_xxxx as prefix.
2021-12-30 16:21:42 +01:00
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
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
Sujith Haridasan
6dfb487810 MDL-71915 core_contentbank: Update behat tests
Update the behat tests to accomodate changes made
for the tertiary navigation.
2021-12-06 10:26:40 +05:30
Paul Holden
8b2423c7a1 MDL-73054 repository_googledocs: avoid $OUTPUT use in data provider. 2021-11-22 22:29:12 +00:00
cescobedo
0a5d387398 MDL-72615 core: Remove boxnet portfolio and repository 2021-10-27 06:24:55 +02:00
Sara Arjona
f02de69971 MDL-72348 repository: Deprecate import from skydrive repo
The repository_skydrive has been removed from core. Methods for
importing files from skydrive to onedrive repository have been
deprecated and will be completely removed in Moodle 4.4.
2021-10-04 09:30:45 +02:00
Sara Arjona
70e6deacee MDL-72348 repository: Remove Microsoft OneDrive legacy (skydrive)
The repository_skydrive was deprecated in 3.3 and here it has been
removed from core.
2021-10-04 09:30:43 +02:00
Ilya Tregubov
34a0ba3232 Merge branch 'MDL-71610-master' of git://github.com/bmbrands/moodle 2021-09-29 15:40:39 +02:00
Bas Brands
16c726cde7 MDL-71610 core_behat: use new edit mode step in feature files 2021-09-29 09:25:36 +02:00
sam marshall
e332d1849d MDL-72643 core: Improve display_size
Allows display_size to use a fixed unit for easy comparison of
multiple results, and fixed decimal places for the same reason.

Improves behaviour by using consistent decimal places and a
consistent space before the unit (the previous one only has a space
before 'bytes', not before 'KB').

Of existing uses, all the ones that displayed a 'maxbytes' type
configuration setting (which are likely to have an 'exact' size
and would be better shown as 512 KB rather than 512.0 KB) have been
changed to use 0 decimal places, to preserve previous behaviour.
All the uses which were showing an actual file or memory size have
been left as default (1 decimal place).
2021-09-27 16:52:33 +01:00
Ilya Tregubov
64bcb34a29 Merge branch 'MDL-70946-master' of git://github.com/peterRd/moodle 2021-09-21 13:08:27 +02:00
Peter Dias
46daeb3ba1 MDL-70946 repository: Reenable and fix the disabled behat test 2021-09-20 08:01:15 +08:00
Sara Arjona
128ebcc4b0 MDL-58939 repository: Remove picasa repository
Picasa is discontinued since 2016 so repository_picasa has been
removed from core Moodle.
2021-09-17 10:46:09 +02:00
Sara Arjona
3f2f2e85bb MDL-72115 course: Rename Miscellaneous category
The "Miscellaneous" course category has been renamed to Category 1.
Besides, the description field has been set from FORMAT_MOODLE to
FORMAT_HTML.
2021-09-13 08:36:17 +02:00
Ilya Tregubov
04a2e1e827 Merge branch 'MDL-70271-master' of git://github.com/peterRd/moodle 2021-07-30 12:24:35 +02:00
Andrew Nicols
776f4bd80c MDL-72179 behat: Make use of page resolvers 2021-07-26 15:14:28 +08:00
Huong Nguyen
9b758d5cc8 MDL-71922 file: Enhance endless recursion requests protection 2021-07-08 23:30:35 +02:00
Helen Foster
ab53075f22 MDL-72063 lang: Import fixed English strings (en_fix) 2021-07-01 14:11:23 +02:00
Peter Dias
cf66500557 MDL-70271 repository_dropbox: Switch to core\oauth2 API
Dropbox is updating their OAuth2 authentication to issue short-term
tokens, which are already supported by core\oauth2\client.

This commit updates the dropbox repository to use the
core\oauth2 API, which has built-in support for tokens and
offline access.
2021-06-22 11:44:11 +08:00
Andrew Nicols
0e7e393748 Merge branch 'MDL-71813-master' of https://github.com/NashTechOpenUniversity/moodle 2021-06-17 11:28:22 +08:00
Sujith Haridasan
0845f53d14 MDL-67975 nextcloud: Add support for Link to file
This change set would bring the following new additions
to the nextcloud repo:
1. Create a new radio button in filepicker: "Link to file"
2. When user clicks this radio button a warning message
   would be created, saying this file would become public.
   Meaning a public link is created in the nextcloud server.
3. Created a sync_reference method to sync the files downloaded
   from nextcloud server. The sync/refresh time given is 1 day/24 hours.
4. Made sure that when the file is downloaded, we use the file
   from moodledata file pool.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-06-09 13:34:31 +05:30
hiendinh
ffb403d9b5 MDL-71813 filepicker: view file not available using keyboard (Enter) 2021-06-03 14:14:21 +07:00
Eloy Lafuente (stronk7)
9d6aa39985 MDL-71583 versions: Add all the missing full-stops to version/requires
It seems that the new phpcs3 checker is now controlling those
line comments that previously were ignored.

This commit just looks for all the cases and bulk-add
them when needed. The bash script (mac) used to add all them is:

while read -r line; do
    arr=(${line//:/ })
    if [[ -n ${arr[0]} ]] && [[ -n ${arr[1]} ]]; then
        echo "  file ${arr[0]}, line ${arr[1]}"
        sed -i "${arr[1]}s/\$/\./" ${arr[0]}
    fi
done < <(find . -name version.php | xargs ag --nomultiline '>(version|requires) *=.*//.*[^;\.]$')
2021-05-11 20:11:07 +02:00
Eloy Lafuente (stronk7)
b0d79e3b18 Merge branch 'MDL-71313' of https://github.com/timhunt/moodle 2021-05-06 23:14:50 +02:00
Sara Arjona
076116e7a6 Merge branch 'MDL-71491' of git://github.com/paulholden/moodle 2021-05-06 18:42:18 +02:00
Paul Holden
72304875ec MDL-71491 repository_flickr: return more file data.
See also 643b0cca.
2021-05-06 16:36:49 +01:00
Shamim Rezaie
9c11ceac1f MDL-69028 repository: Put a rate limit on draft file uploads 2021-05-04 17:23:11 +02:00
Adrian Greeve
c94a0090e0 Merge branch 'MDL-71481' of git://github.com/paulholden/moodle 2021-04-30 11:19:02 +08:00
Paul Holden
643b0ccabe MDL-71481 repository_flickr_public: return more file data.
A HTTP HEAD request is required to get the image filesize.
The remaining data can be obtained from existing calls to
the Flickr API.
2021-04-29 09:48:19 +01:00
Mihail Geshoski
49ce037665 MDL-71470 repository_googledocs: Update unit tests 2021-04-28 16:30:27 +08:00
Mihail Geshoski
0ce519591b MDL-71470 repository_googledocs: Use file name in the source attribute
Instead of using the file title when generating the source attribute,
we should be using only the name of the Google Drive file in order to
avoid having the original extension within the filename after the file
is imported and added into Moodle.
2021-04-28 16:30:27 +08:00
Marina Glancy
0152fdbdff MDL-71017 oauth2: configure some oauth2 services for login only 2021-04-20 10:50:40 +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
Mihail Geshoski
5f4bdefc54 MDL-61768 repository_googledocs: Deprecate unused methods
Deprecates methods from the repository_googledocs class which are
no longer used.
2021-04-15 12:40:32 +08:00
Mihail Geshoski
6528181e72 MDL-61768 repository_googledocs: Add unit tests
Adds unit tests for the newly introduced methods related to the content
browsing and searching functionallity across drives.
2021-04-15 12:40:32 +08:00
Mihail Geshoski
54a850640d MDL-61768 repository_googledocs: Support shared drives
Enables the Google Drive repository to support browsing and searching
for content from the existing shared drives.
2021-04-15 12:40:32 +08:00
Mihail Geshoski
241e778ca7 MDL-61768 repository_googledocs: Rest API function to list shared drives
Adds a new rest API function in the googledocs repository which would
return the existing shared drives.
2021-04-15 11:06:11 +08:00
Tim Hunt
385ce8a5e1 MDL-71313 repositories: warn if get_instances context is wrong type 2021-04-12 20:30:43 +01:00
Eloy Lafuente (stronk7)
cfba0366db Merge branch 'MDL-70893-master' of git://github.com/marinaglancy/moodle 2021-03-18 00:23:26 +01: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
Marina Glancy
465d1ef495 MDL-70921 repository: filter function can not accept argument by ref
PHP8.0 shows error that filter function accepts value by reference
The nested filtering was never working but also this function was never called on a tree with sub-levels,
so this logic is now removed
2021-02-25 18:24:52 +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
Marina Glancy
0eada7a5f9 MDL-70893 various: optional function arguments must be in the end 2021-02-15 16:53:37 +01:00
Andrew Nicols
3b7a564e17 Merge branch 'MDL-70429-master' of git://github.com/sarjona/moodle 2021-02-08 12:02:11 +08:00