121 Commits

Author SHA1 Message Date
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Juan Leyva
51c9c709a9 MDL-75058 course: Fix support for dates on WebServices 2022-06-27 15:29:36 +02:00
Peter Dias
2c27a33213 MDL-74276 report: Update behat tests to account for new page. 2022-04-01 12:44:04 +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)
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)
0c53a3dec8 MDL-73476 phpunit: events, external and search tescase names
All events_test, external_test and search_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 lib/external/tests/external_test.php:
- external is not a valid component
- hence, its only valid namespace is "core"
- also, it's testing lib/external/externallib.php
- hence, the file (and class) have been renamed to external_externallib_test.php
  (to avoid conflicts with other external_test that may exist in core)
2022-01-14 16:18:39 +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
Ilya Tregubov
6f44f008d8 Merge branch 'MDL-73278' of https://github.com/stronk7/moodle 2021-12-10 18:51:40 +02: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
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
Mathew May
b983003e2e MDL-70197 navigation: Remove old navigation elements and migrate behat 2021-11-29 15:47:42 +08:00
Adrian Greeve
c4c00f4e69 MDL-71912 mod_choice: Small alteration to show responses.
Depending on whether the secondary navigation is shown or not will
determine if the link to the responses is shown on the view.php
page.

Co-authored-by: Sujith Haridasan <sujith@moodle.com>
2021-11-09 11:24:08 +08:00
Mihail Geshoski
7d821080f0 MDL-72093 navigation: Update behat tests 2021-09-14 12:02:35 +08:00
Jun Pataleta
300d0bc03a MDL-69588 mod: Additional Behat step fixes 2021-08-25 10:35:33 +08:00
Adrian Greeve
f28535082c MDL-70196 behat: Add a new step for navigating with the navbar.
- Part of: MDL-69588
A lot of tests work on the basis that you can follow the last item
of the breadcrumb nav bar. This is not the case. This step will first
check to see if the page is already the one requested. If it is then
nothing further needs to happen, otherwise we follow the link in the
navbar.
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
Andrew Nicols
9f428f68c7 MDL-72179 behat: Add activity editing page resolution 2021-07-23 20:43:48 +08:00
Sara Arjona
b04d1c3041 Merge branch 'MDL-71163-master' of git://github.com/rezaies/moodle 2021-05-03 11:59:58 +02:00
Sara Arjona
1e40093bfa MDL-66431 behat: fix goutte + classic failure 2021-05-03 09:32:04 +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
Shamim Rezaie
0fc6bfab6c MDL-71163 mod_choice: remove duplicate info for timeopen and timeclose 2021-04-30 17:13:56 +10:00
Michael Hawkins
53707660dc MDL-71162 mod_choice: Updated completion behat to use latest rules 2021-04-29 00:41:07 +08:00
Jun Pataleta
98f44ac00d MDL-70817 mod_choice: Behat tests for the activity completion info 2021-04-02 21:53:20 +08:00
Shamim Rezaie
029d6102ea MDL-70816 mod_choice: activity_dates implementation 2021-03-22 16:15:24 +11:00
Jun Pataleta
2f0914e55f MDL-70815 mod_choice: Unit tests for the custom completion class 2021-03-09 20:15:28 +08:00
Eloy Lafuente (stronk7)
d95c378771 MDL-67673 phpunit: Remove expectedException annotations
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

The annotations `@expectedException`, `@expectedExceptionCode`,
`@expectedExceptionMessage`, and `@expectedExceptionMessageRegExp`
are now deprecated.
Using these annotations will trigger a deprecation warning
in PHPUnit 8 and in PHPUnit 9 these annotations will be removed.

Also, all uses of expectExceptionMessageRegExp() has been moved
to expectExceptionMessageMatches(). See https://github.com/sebastianbergmann/phpunit/issues/3957

TODO: Various weirdness found while doing the changes with these tests:
- vendor/bin/phpunit lib/tests/exporter_test.php (created MDL-69700)
- vendor/bin/phpunit competency/tests/external_test.php (same issue than prev one)
- vendor/bin/phpunit question/engine/tests/questionengine_test.php (created MDL-69624)
- vendor/bin/phpunit lib/tests/event_test.php (created MDL-69688)
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
Luca Bösch
84197640eb MDL-37745 mod_choice: Show taken and limit. 2020-07-26 00:08:37 +02:00
John Yao
96e444665e MDL-65517 block_timeline: Hide completed course modules in Timeline
When some activities are manually completed by students, some are still showing in students' timeline.
This commit fix that for module assign,chat,choice,feedback,lesson,quiz,scorm and workshop.
2019-07-12 09:16:40 +10:00
Mathew May
27deb59557 MDL-64506 mod_choice: fix behat issue with screensize
We found issues in FireFox where Behat could not scroll to select
the student two checkbox.
2019-04-05 12:10:00 +02:00
Eloy Lafuente (stronk7)
71505bed78 MDL-64943 behat: fix some remaining uses of old strings 2019-03-05 19:17:07 +01:00
Shamim Rezaie
b96446f3af MDL-63665 mod_choice: support removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-10-26 18:48:02 +11:00
David Monllao
25561b3751 Merge branch 'MDL-63135-master' of git://github.com/rezaies/moodle 2018-09-19 13:12:40 +02:00
Shamim Rezaie
a8df987e07 MDL-63135 mod_choice: Check if the module is visible to the user 2018-09-06 20:14:04 +10:00
Shamim Rezaie
1b82088f98 MDL-63135 mod_choice: Add userid param to mod_choice calendar callback 2018-09-06 20:09:50 +10:00
Shamim Rezaie
0ec076ef34 MDL-63135 mod_choice: Added choice_get_user_response function
A new function to return choice answers records of a given user in a given choice activity.
2018-09-06 20:01:05 +10:00
Neill Magill
196aa50489 MDL-62944 activities: Test adding activities with no calendar capability 2018-08-31 10:15:36 +01:00
Jake Dallimore
5a8791336a MDL-56881 mod_choice: add unit tests for choice_user_submit_response
Tests cover option limits and multiple option responses.
2018-07-09 11:02:50 +08:00
Mark Nelson
8e24041287 MDL-62428 core: fix incorrect early return in privacy providers 2018-05-14 13:06:29 +08:00
Juan Leyva
10b67ef9f1 MDL-60882 mod_choice: Avoid teacher delete all responses
Teachers should be able to delete all responses but when indicating the
response ids.
When the response ids are not passed, only their own responses should
be deleted (as the function documentation said).
2018-04-26 10:25:45 +02:00
Jake Dallimore
f1c1db434a MDL-61475 mod_choice: Update core_privacy implementation 2018-03-14 09:36:03 +08:00
Jun Pataleta
138816b1b1 MDL-61475 mod_choice: Add implementation of Privacy API 2018-03-14 09:36:03 +08:00
Luca Bösch
91e2e5e7a2 MDL-58845 mod_choice: Fix behat related tests 2018-02-22 08:30:51 +08:00
Eloy Lafuente (stronk7)
8cd0679099 Merge branch 'MDL-2051-master-2' of git://github.com/junpataleta/moodle 2017-12-26 01:25:14 +01:00
Jun Pataleta
3af40cc62e MDL-58888 mod_choice: Verify sorting when testing multiple selections
* Improve test_choice_get_my_response() to verify the sorting of the
  responses returned by choice_get_my_response().
* Fix correct usage of choice_get_my_response().
2017-12-15 15:53:11 +13:00
Jun Pataleta
3cd76cbecc MDL-2051 mod_choice: Show info how choice results will be published 2017-12-13 14:36:03 +13:00
Ryan Wyllie
478b1d194f MDL-60062 calendar: remove validate_event_timestart callback 2017-11-07 01:25:33 +00:00
Ryan Wyllie
8c4b939cfe MDL-60058 choice: implement timestart range callback for calendar UI 2017-10-13 06:38:02 +00:00