146 Commits

Author SHA1 Message Date
Jason A Everling
6f4011db33
MDL-62839 mod_lti: change instructorchoiceacceptgrades default value
update mod_lti behat test: renametool.feature, added  "Accept grades from the tool" to "1"
2023-02-09 10:22:17 -06:00
Paul Holden
f256b82879 Merge branch 'MDL-73847' of https://github.com/jonof/moodle 2023-02-01 10:00:22 +00:00
Jake Dallimore
9981e1ec2e MDL-77077 mod_lti: Fix JWT signature verify when alg missing from JWKS
Infer the algorithm, where necessary, using a combination of JWT
headers and known valid LTI algorithms.
2023-01-30 16:44:23 +08:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Jonathon Fowler
c9fe46fe3d MDL-73847 lti: fetch keyset URLs using configured proxy settings 2023-01-16 10:00:17 +10:00
Claude Vervoort
12e207de9d MDL-69275 mod_lti: submission review (gradebook launch) 2022-10-26 15:03:41 -04:00
Eloy Lafuente (stronk7)
0ed53be9b2 MDL-66902 tests: Fix all incorrect namespaces
This issue just goes over all the currently incorrect
namespaces in test cases and:

1. Change the namespace to the correct one.
2. Move/rename it to correct location if needed (level 2 and down).
3. Remove not needed MOODLE_INTERNAL check when possible.
4. Remove file phpdoc when the file only has one class.
5. Make small adjustments in case the change of namespace requires it.
2022-09-26 14:12:16 +02:00
Tim Hunt
8babdbd396 MDL-74608 activities: a new option to force the activity language
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.

The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
2022-08-15 22:15:52 +01:00
Tim Hunt
6c161f3b99 MDL-74760 activity web services: refactor duplicate code 2022-06-07 12:53:34 +01:00
Eloy Lafuente (stronk7)
caf55abf17 MDL-74413 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- Moved to the level2 "privacy" namespace:
  - \mod_assign\privacy\feedback_legacy_polyfill_test
  - \mod_assign\privacy\submission_legacy_polyfill_test

- Moved to the level2 "task" namespace:
  - \core_message\task\migrate_message_data_test
  - \ltiservice_gradebookservices\task\cleanup_test
  - \message_email\task\send_email_test
  - \mod_lti\task\clean_access_tokens_test
  - \mod_workshop\task\cron_task_test

- Moved to the level2 "event" namespace:
  - \core_h5p\event\deleted_test
  - \core_h5p\event\viewed_test

- Renamed to a better name:
  - backup_forum_activity_task_test.php (missing "task")
2022-05-07 20:32:30 +02:00
Jun Pataleta
935a18f7b0 Merge branch 'MDL-73848-master' of https://github.com/junpataleta/moodle 2022-03-25 17:58:18 +08:00
Sujith Haridasan
1bb972ae0a MDL-73848 administration: Add tests for breadcrumbs and nav highlights
This change includes addition of tests for verifying the secondary
and tertiary nav highlights.
It also includes the tests to verify the breadcrumbs for the pages.
2022-03-25 17:44:58 +08:00
Sara Arjona
838704aa85 MDL-74184 behat: Unrelated, remove the @skip_interim tag
This commit is UNRELATED to the MDL-74184, but we need the
@skip_interim tag removed to a couple of scenarios that were
causing lots of noise and failures @ci infrastructure.
MDL-74265 was created to deal with this issue but these jobs
are now passing, and nothing has been changed...

So we are using MDL-74184 (this extra commit) to remove that
tag (sorry for the noise).
2022-03-22 17:22:58 +01:00
Sara Arjona
5584c7b6a6 MDL-74116 behat: Unrelated, add the @skip_interim tag
This commit is UNRELATED to the MDL-74116, but we need the
@skip_interim tag added to a couple of scenarios that are
causing lots of noise and failures  @CI infrastructure.
MDL-74265 has been created to deal with this issue.

So we are using MDL-74116 (this extra commit) to add that tag
(sorry for the noise).
2022-03-18 13:45:42 +01:00
Eloy Lafuente (stronk7)
d66a5316ae MDL-73826 phpunit: Allow curl mock responses to handle empty strings
Before this commit, is_empty() was being applied before returning
the mock response. But we want to be able to mock the empty response
for some tests, hence moving the condition to null/isset, that is
the value that array_pop() returns where there aren't more elements
in the array.

With that change performed, we can test lti_load_cartridge() with
empty responses, hence adding a new test for that.
2022-02-11 23:50:05 +01:00
Eloy Lafuente (stronk7)
100bc51f1d MDL-73485 phpunit: externallib, generator and filter tescase names
All externallib_test, generator_test and filter_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to tests under testing/tests:

1) The core_testing component doesn't exist.
2) But testing/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 testing_xxxx as prefix.

Finally, also modified calendar/tests/events/events_test.php because it uses
some renamed (core_calendar_externallib_testcase => \core_calendar\externallib_test)
classes.
2022-01-21 19:48:23 +01:00
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
Bas Brands
f2ddd23ec1 MDL-71457 theme_boost: activity icon styling 2021-12-20 15:02:24 +01: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
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
Andrew Madden
f435f313e0 MDL-69092 mod_lti: Add pagination to toolconfigure.php.
* Add local function to access subsets of proxies and types direct from DB.
* Add local function to access count of proxies and types direct from DB.
* Add new external function to get both proxies and types with pagination.
* Add new external function to get count of proxies and types.
* Implement pagination using page factory in JS.
* Added unit tests to cover new external functions.
* Add mod_lti behat generators and tests.
* Show first and last button in paging bar.
* Created helper class to assist with new functions.
2021-11-17 22:44:56 +11:00
Stephen Vickers
6fa817db27 MDL-72552 mod_lti: Add context_memberships_v2_url custom parameter 2021-10-26 15:47:45 +01:00
Peter Dias
7ab2d7d7bd MDL-52206 quiz: Integration bug fixes 2021-10-08 07:33:05 +02:00
Peter
7a9e3db9dc MDL-52206 completion: Behat test
Co-authored-by: aanabit
2021-10-07 10:17:25 +08:00
Eloy Lafuente (stronk7)
b97c021a98 Merge branch 'MDL-69504-master' of https://github.com/snake/moodle 2021-09-07 20:03:45 +02:00
Jake Dallimore
38ff4d528e MDL-69504 mod_lti: check role switches when setting lti roles on launch
is_siteadmin isn't aware of role switches, so make sure we're not in a
switched role before calling that method.
2021-08-24 14:33:11 +08:00
Adrian Greeve
7d435fb5f2 MDL-70196 navigation: Update to feature files.
- Part of: MDL-69588
A lot of tests rely on the last element of the breadcrumb being
active. This updates feature files to not rely on this anymore.
2021-08-23 17:46:38 +08:00
Andrew Nicols
776f4bd80c MDL-72179 behat: Make use of page resolvers 2021-07-26 15:14:28 +08:00
Eloy Lafuente (stronk7)
47f708fc30 MDL-71782 behat: Ensure page after saving changes is there
A similar approach was followed @ MDL-67935, although the
case doesn't seem to be the same.

In any case, it's curious that all local execution are
100% passing and only CIs fail so often. Just guessing if,
maybe, there is some Chrome version factor around (we
are running older, sticky, versions @ CIs.
2021-07-10 00:18:33 +02:00
David Mudrák
ad30fde448 MDL-71425 lang: Fix reworded strings in tests 2021-05-04 17:45:18 +02:00
Ilya Tregubov
7d9fa772d9 MDL-66431 core: Fix lti test for classic theme. 2021-05-02 16:06:17 +02:00
Ilya Tregubov
cf1cf222e7 MDL-66431 core: Fix behat tests.
Move activity creation to data generators. Only fixing those
tests failing due to removing usemodchooser preference.
2021-05-01 16:22:03 +02:00
Sara Arjona
d54a89ad2e Merge branch 'dynreg-upgrade-squash' of https://github.com/cengage/moodle 2021-04-21 09:58:29 +02:00
Claude Vervoort
ca80d53b38 MDL-70500 lti: dyn reg can be used to update tools 2021-04-20 17:12:28 -04:00
Michael Hawkins
7ffc5a7160 MDL-71334 mod_lti: Fix manual activity completion behat test 2021-04-16 14:09:55 +08:00
Michael Hawkins
e3fb51e3c8 MDL-71161 mod_lti: Display activity completion information 2021-04-13 01:21:12 +08:00
Víctor Déniz
92e59b663d Merge branch 'MDL-70284-dynreg-bug' of https://github.com/cengage/moodle 2020-12-21 16:39:08 +00:00
Claude Vervoort
33594cf3a4 MDL-70284 mod_lti: dynreg fix response claims 2020-11-25 10:52:12 -05: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
Jun Pataleta
1ec3dda801 Merge branch 'MDL-67301-dynreg-squashed' of https://github.com/cengage/moodle 2020-10-26 12:40:31 +08:00
Claude Vervoort
84e90d5db4 MDL-67301 mod_lti: dynamic registration 2020-10-24 09:27:55 -04: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
Andrew Madden
8177ccf566 MDL-67695 mod_lti: Use correct return structure for get_tool_proxies.
* Deprecated serialise_tool_proxy() as no longer used.
* Use tool_proxy_return_structure for each proxy.
* Added tests for getting all proxies and orphaned proxies.
2020-10-20 04:08:35 +11:00
Adrian Greeve
611a42b934 Merge branch 'MDL-68384-fix-spec-violations' of https://github.com/cengage/moodle 2020-10-09 12:06:37 +08:00
Claude Vervoort
957da4b564 MDL-67473 mod_lti: deeplinking multiple support
AMOS BEGIN
 CPY [contentitem_help,mod_lti],[contentitem_deeplinking_help,mod_lti]
AMOS END
2020-09-30 08:03:59 -04:00
Claude Vervoort
7263f2855d MDL-68384 mod_lti: fix spec violations bo claim name and dl value type 2020-09-28 16:53:33 -04:00
Claude Vervoort
5b8c646e68 MDL-66934 mod_lti: support context history param 2020-09-18 14:11:34 -04:00