121 Commits

Author SHA1 Message Date
Andrew Nicols
92179b7057 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08: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
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
Sara Arjona
e5872a3b45 MDL-67999 contentbank: Remove contentbank/upload.php
As the form to upload files to the content bank has been moved to
modal, this file is not required any more, so it has been removed.
2021-04-14 18:10:04 +02:00
Sara Arjona
dcf94b0ca2 MDL-67999 contentbank: Make upload/replace files modal form
Once MDL-64554 landed, content bank can implement the original
proposal, using a modal form when uploading files.
2021-04-14 18:04:10 +02:00
Sara Arjona
9c07064417 MDL-67999 core_contentbank: Add namespace to upload form
The form to upload/replace files has been moved to classes/form
(it's where it should have been added when it was created).
Besides, this class has been renamed because now, with the
namespace, contentbank and form don't need to be in the name ;-)
2021-04-14 18:04:09 +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
Eloy Lafuente (stronk7)
bd2efca873 Merge branch 'MDL-70941-master' of git://github.com/dravek/moodle 2021-03-01 09:54:00 +01:00
David Matamoros
05e4c75ca5 MDL-70910 contentbank: fix for using contentid not validated 2021-02-26 14:36:39 +01: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
Ilya Tregubov
1ec93d4747 MDL-69529 contentbank: Remove redundant code. 2021-01-04 09:28:17 +02:00
Amaia Anabitarte
66be08216e MDL-69046 core_contentbank: Escape quotes when showing name 2020-11-03 12:34:28 +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
Amaia Anabitarte
08687a5198 MDL-69672 core_contentbank: Check used context level 2020-09-29 17:46:10 +02:00
Bas Brands
a522ded1e3 MDL-69454 core_search: consistent content bank search 2020-09-21 11:54:53 +02:00
Amaia Anabitarte
22da620a7c MDL-68688 core_contentbank: Empty content bank notification 2020-09-10 11:58:28 +02:00
Andrew Nicols
805cca26fd Merge branch 'MDL-69270-master' of git://github.com/ferranrecio/moodle 2020-09-01 07:26:02 +08:00
Andrew Nicols
e1f3746112 MDL-69269 contentbank: Fix issues identified in integration 2020-09-01 07:26:01 +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
Andrew Nicols
d606ed13bc Merge branch 'MDL-69473-master' of git://github.com/sarjona/moodle 2020-08-20 07:39:22 +08:00
Andrew Nicols
7cd63bde9f Merge branch 'MDL-69089-master' of git://github.com/aanabit/moodle 2020-08-19 08:18:16 +08: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
Amaia Anabitarte
dfd8f6b56e MDL-69089 core_contentbank: Tests for empty content names 2020-08-17 15:54:36 +02:00
Amaia Anabitarte
5ea98dc5b1 MDL-69089 core_contentbank: Empty content names are not allowed 2020-08-17 15:54:36 +02:00
Sara Arjona
5028169b26 MDL-69473 contentbank: change incorrect ref to size in type column 2020-08-14 08:53:49 +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
088786d284 MDL-69047 core_contentbank: Hard coding status messages 2020-06-18 18:06:30 +02:00
Luca Bösch
061893d89b MDL-69060 core_contentbank: fix contenbank typos. 2020-06-15 13:35:43 +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
Jun Pataleta
ea9a854bb6 Merge branch 'MDL-68962-master' of git://github.com/sarjona/moodle 2020-06-09 11:30:37 +08:00
Amaia Anabitarte
7be38070d4 MDL-68936 core_contentbank: Behat test for editing capabilities 2020-06-08 16:40:10 +02:00
Amaia Anabitarte
0633e60a91 MDL-68936 core_contentbank: Checking manage permissions to allow editing 2020-06-08 16:40:10 +02:00