78 Commits

Author SHA1 Message Date
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Jake Dallimore
2c38a73fe7 MDL-76926 enrol_lti: remove guzzle shim code as guzzle now in core 2023-03-13 10:42:56 +08:00
David Pesce
ab1b671110 MDL-77232 enrol_lti: Parallelize lti (1.3) gradesync using adhoc tasks 2023-03-02 09:33:20 -05:00
Paul Holden
6bd76e2a4d Merge branch 'MDL-76803-master' of https://github.com/junpataleta/moodle 2023-01-10 16:24:09 +00:00
Jun Pataleta
2924075480 MDL-76803 lang: Update usages of reworded email display options 2023-01-10 16:01:18 +08:00
Jake Dallimore
6331a834a4 MDL-75532 enrol_lti: add tests for coupled and decoupled line items
This covers the following cases:
1. Where only the 'lineitem' service endpoint is provided
2. Where only the 'lineitems' service endpoint is provided.
Existing tests already cover the case where both are provided.
2023-01-09 11:36:04 +08:00
Jun Pataleta
da9aec83a6 Merge branch 'MDL-69251-master' of https://github.com/snake/moodle 2022-08-04 11:16:22 +08:00
Jun Pataleta
301db762d6 Merge branch 'MDL-75182-master' of https://github.com/snake/moodle 2022-07-19 22:47:25 +08:00
Jake Dallimore
273d9d561d MDL-68843 enrol_lti: add tests covering disabled instances in tasks
Verify the expected behaviour of the sync_members and sync_grades tasks
when enrolment instances are disabled, whether as a byproduct of module
deletion, or as status change made by the user.
2022-07-18 16:13:48 +08:00
Jake Dallimore
3387e63736 MDL-68843 enrol_lti: auto disable orphaned enrolment instances
- pre_course_module_deletion hook to disable on mod delete
- upgrade step dealing with legacy orphaned records
2022-07-18 16:08:18 +08:00
Denis Brat
9f7eafbf7b MDL-69251 enrol_lti: fix sync_members task inconsistent internal state 2022-07-15 12:17:08 +08:00
Jake Dallimore
dc20ae685f MDL-75182 enrol_lti: remove installed lang assumptions from unit tests
Don't assume 'fr' isn't installed, or that 'en' is. Use known
non-existent languages and known installed languages for the relevant
test cases.
2022-07-08 10:05:41 +08:00
Jake Dallimore
0d6759dad0 MDL-74691 enrol_lti: add coverage of lti-ags claim variations to service
This test verifies how the service handles changes in the lti-ags claim
sent over several launches - ensuring the claim data is updated each
time.
2022-06-16 14:55:09 +08:00
Jake Dallimore
f714c61b82 MDL-74691 enrol_lti: allow omission of lineitems property in ags claim
The claim is valid with either or both of the URLs, so long as there's
at least one.
2022-06-16 12:50:42 +08:00
Shamim Rezaie
a239d8e182 Merge branch 'MDL-74699-master' of https://github.com/snake/moodle 2022-06-03 14:45:30 +10:00
Jake Dallimore
4b93776f4b MDL-74699 enrol_lti: fix clientid retrieval from aud during launches 2022-05-12 09:20:02 +08:00
Eloy Lafuente (stronk7)
9f53b0e965 MDL-73971 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:

- Some fixtures, initially defined in the test files have been
  moved to new files in fixtures subdirectory, leaving the unit
  test files clearer:
  - moodle2_course_format_test.php
- Rename wrong named test:
  - baseoptiogroup_test = baseoptigroup_test
2022-05-06 18:29:11 +02:00
Jake Dallimore
8f59d0b937 MDL-74576 enrol_lti: allow unsupported scopes in ags_info
Instead of hard blocking launches with extension scopes, just ignore
the unsupported scopes and continue.
2022-05-02 15:37:52 +08:00
Jake Dallimore
9343f94131 MDL-74312 enrol_lti: fix copytoclipboard trigger element
This should be a button given it's an action, and making it a button
means it can be activated using either the space or enter keys, instead
of just enter.
2022-04-20 09:31:48 +08:00
Víctor Déniz
a51d24c8a8 MDL-74330 lang: Replace modified strings in tests 2022-04-01 13:17:18 +01:00
Andrew Nicols
fa6920327e MDL-74221 enrol_lti: Update tests to match new icon and strings 2022-03-31 23:29:02 +08:00
Jake Dallimore
662c659324 MDL-74221 enrol_lti: change registration workflow to support drafts
This changes the admin pages such that to see the endpoints required
by the platform, an admin user must first create a draft registration.
This allows the registration uniqueid to be generated and included in
the initiate login and dynamic registration URLs.
2022-03-31 12:15:46 +08:00
Jake Dallimore
e399b3995e MDL-69542 enrol_lti: behat feature covering tool registration 2022-02-11 11:07:26 +08:00
Jake Dallimore
66b76c4545 MDL-69542 enrol_lti: remaining changes for dynamic registration support
- Allow the tool to generate secure, one time, dynamic registration
URLs for use in supporting platforms.
- Registration endpoint, which validates the one time URL, makes
the registration requqest to the platform and adds the approriate
tool registration changes in the tool on success.
- Admin settings pages make use of the 'copy to clipboard' module
which is now in core.
2022-02-11 11:06:05 +08:00
Jake Dallimore
d5ed4a3184 MDL-69542 enrol_lti: add LTI Advantage grade sync task
This change adds a new grade sync task for LTI Advantage and updates
the legacy task such that it only operates on legacy tools. This uses
the assignment and grades service 2.0.
2022-02-11 11:03:32 +08:00
Jake Dallimore
1f27bad809 MDL-69542 enrol_lti: add LTI Advantage member sync task
This change adds a new member sync task for LTI Advantage and updates
the legacy task such that it only operates on legacy tools. This uses
the names and roles provisioning service 2.0.
2022-02-11 11:03:00 +08:00
Jake Dallimore
2516938537 MDL-69542 enrol_lti: add version based resource publication
Adds tabs and a new table allowing LTI Advantage published resources
to be viewed.
2022-02-11 10:51:59 +08:00
Jake Dallimore
c6c7b1dadc MDL-69542 enrol_lti: add generators for use in LTI Advantage behat 2022-02-11 10:50:06 +08:00
Jake Dallimore
983038161a MDL-69542 enrol_lti: add message_helper utility class 2022-02-11 10:49:30 +08:00
Jake Dallimore
9d5264d500 MDL-69542 enrol_lti: add tool launch service 2022-02-11 10:47:12 +08:00
Jake Dallimore
c41ff5161d MDL-69542 enrol_lti: add tool deployments service 2022-02-11 10:38:41 +08:00
Jake Dallimore
0f6239a054 MDL-69542 enrol_lti: add application registration service 2022-02-11 10:32:49 +08:00
Jake Dallimore
948746eae7 MDL-69542 enrol_lti: make lib changes supporting LTI Advantage
This change includes:
- LTI Advantage specific code in delete_instance().
- LTI version field added to publish as lti tool form.
- LTI Advantage specific uuid added to add_instance().
- Moved secret validation (LTI1.1/2.0) to server side, allowing
the element to be hidden in LTI Advantage cases.
2022-02-11 10:24:49 +08:00
Jake Dallimore
dad46e813b MDL-69542 enrol_lti: implement classes required by the lti13 library 2022-02-11 10:23:31 +08:00
Jake Dallimore
5649c72d43 MDL-69542 enrol_lti: add published resource view object support
The view objects introduced here will be used as a representation of
data during the content selection process.
2022-02-11 10:22:24 +08:00
Jake Dallimore
4049c08998 MDL-69542 enrol_lti: add entity repositories 2022-02-11 10:20:21 +08:00
Jake Dallimore
a7d864a609 MDL-69542 enrol_lti: add base test class for lti advantage
Contains a collection of useful LTI Advantage specific methods.
2022-02-11 10:18:34 +08:00
Jake Dallimore
7a1f433043 MDL-69542 enrol_lti: add new entity classes for storing launch data 2022-02-11 10:12:57 +08:00
Eloy Lafuente (stronk7)
7a0d024e60 MDL-73659 phpunit: restore_date, api, rule, plugin, manager & helper
All restore_date_test, api_test, rule_test, plugin_test,
manager_test, helper_test 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:

- All restore_date_test cases have been put under xxx\backup
  level 2 (valid API) namespace.
2022-02-05 00:03:32 +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
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
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
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
Brendan Heywood
300213ee2e MDL-70424 auth: Avoid random changes to $CFG->auth 2021-02-23 11:40:57 +11:00
Eloy Lafuente (stronk7)
3a5641cb74 MDL-67673 phpunit: Remove deprecated assertEquals() params
The optional parameters of assertEquals() and assertNotEquals()
are deprecated in PHPUnit 8 (to be removed in PHPUnit 9):

- delta => use assertEqualsWithDelta()
- canonicalize => use assertEqualsCanonicalizing()
- ignoreCase => use assertEqualsIgnoringCase
- maxDepth => removed without replacement.

More info @ https://github.com/sebastianbergmann/phpunit/issues/3341

Initial search done with:

ag 'assert(Not)?Equals\(.*,.*,' --php

Then, running tests and fixing remaining cases.
2020-10-21 12:46:00 +02: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
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
Shamim Rezaie
9f8a30c27c MDL-63649 enrol_lti: support removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-10-23 11:54:41 +11:00
Andrew Nicols
e8449116ef MDL-57281 enrol_lti: Nav to Published as LTI tools 2018-08-23 08:08:59 +08:00