38 Commits

Author SHA1 Message Date
Paul Holden
1bf87e87a4 MDL-76839 mod_data: correct external test class coverage notation. 2023-01-10 12:59:06 +00:00
Laurent David
e861d7b0ad MDL-75664 mod_data: Approval status in database entries
* Add approval status in the default template.
* Change the language string for unapproved entries.
2022-10-17 09:55:11 +02:00
Sara Arjona
cb4b6f125b MDL-75353 mod_data: always return str in data_generate_default_template
From now on, the data_generate_default_template method will always return
a string with the template content or an empty string when there is no
content available (for instance, when the database has no fields).
This method won't return a boolean anymore.
2022-08-19 08:42:15 +02:00
Andrew Nicols
903f04a320 Merge branch 'MDL-74608' of https://github.com/timhunt/moodle 2022-08-18 10:52:02 +08: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
Amaia Anabitarte
cb01747608 MDL-75137 mod_data: Add entry throws an exception if there is no field 2022-08-12 15:46:08 +02: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
Juan Leyva
8169aeff59 MDL-67015 mod_data: Prevent users adding entries to other groups 2020-11-03 12:34:28 +01: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
Juan Leyva
62ff1b954f MDL-66877 mod: Fix WebServices returning unfiltered activity names 2019-11-28 17:18:29 +01:00
Juan Leyva
dfd4881589 MDL-65026 course: Fix modules intro formatting in WS
The Web Service seems to be doing excessive text cleaning.
2019-09-16 13:04:26 +02:00
Juan Leyva
6c344ff282 MDL-64656 core_tag: Return tags in modules and blog 2019-04-11 10:20:44 +02:00
Andrew Nicols
c40f6adbe0 MDL-64971 access: Ensure that the capability exists when fetching 2019-03-06 10:16:06 +08:00
Juan Leyva
21824a9325 MDL-60433 mod_data: Fix groups in Web Services 2017-10-13 12:42:10 +02:00
Juan Leyva
26d8bceac2 MDL-57407 mod_data: Return ratings in mod_data_get_entry 2017-09-08 13:49:10 +02:00
Dan Poltawski
f4ba6def50 Merge branch 'MDL-59624-master' of git://github.com/jleyva/moodle 2017-07-31 15:54:32 +01:00
Dan Poltawski
9ee4ab6330 Merge branch 'MDL-59619-master' of git://github.com/jleyva/moodle 2017-07-31 11:48:55 +01:00
Juan Leyva
6cf2ab7394 MDL-59627 mod_data: Fix totalcount calculation in search_entries
totalcount was incorrectly calculated for normal search.
For advanced search it was working as expected.
This was making searched entries pagination behave incorrectly.
2017-07-25 18:41:12 +02:00
Juan Leyva
be4bdab78a MDL-59624 mod_data: Return maxcount in WS mod_data_search_entries 2017-07-25 15:55:22 +02:00
Juan Leyva
84c2a87b80 MDL-59619 mod_data: Fix get_fields WS for databases without fields 2017-07-25 14:45:10 +02:00
Jun Pataleta
cefd780fa3 MDL-58462 mod_data: Generate users with different names
* Give test users different first and last names.
* Declare class member variables instead of dynamically assigning them.
* Rename member variable $data to $database since it conflicts with the
  private member variable PHPUnit_Framework_TestCase::$data.
* Replace setExpectedException usage with expectException().
2017-04-03 13:49:25 +08:00
Juan Leyva
b0f3e6d618 MDL-57924 mod_data: Fix get_entry call
It was using the pre-integration version where a group was mandatory
2017-03-30 09:29:08 +02:00
Juan Leyva
4ca2890d8e MDL-57924 mod_data: New WS mod_data_update_entry 2017-03-30 02:36:32 +02:00
Juan Leyva
61c640c13a MDL-57923 mod_data: New WS mod_data_add_entry 2017-03-30 02:28:54 +02:00
Juan Leyva
67bb168e1f MDL-57922 mod_data: New Web Service mod_data_delete_entry 2017-03-30 02:15:46 +02:00
Juan Leyva
229158fe74 MDL-57921 mod_data: New WS mod_data_approve_entry 2017-03-30 02:12:53 +02:00
Juan Leyva
56b8edcb1e MDL-57920 mod_data: New WS mod_data_search_entries 2017-03-30 01:53:46 +02:00
Juan Leyva
a934c89639 MDL-57919 mod_data: New WS mod_data_get_fields 2017-03-29 11:38:39 +02:00
Juan Leyva
771effef8d MDL-57918 mod_data: New WS mod_data_get_entry 2017-03-24 15:19:46 +01:00
Juan Leyva
ef6aea9db8 MDL-49409 mod_data: New Web Service mod_data_get_entries 2017-03-21 23:03:01 +01:00
Juan Leyva
cac43b9b6a MDL-57916 mod_data: New WS mod_data_get_access_information 2017-03-15 11:48:08 +01:00
Juan Leyva
9fac7c8640 MDL-57915 mod_data: New Web Service mod_data_view_database 2017-03-13 19:21:08 +01:00
Juan Leyva
f97305b025 MDL-57914 mod_data: Refactor get_databases_by_courses
- Use a exporter
- Return more fields for users with the view entry capability enabled
2017-03-02 22:57:05 +01:00
Juan Leyva
7ef49bd393 MDL-54951 webservice: Return intro text files in modules 2016-07-04 09:24:28 +01:00
Dan Poltawski
4539892cda MDL-53149 mod_data: update backup and webservices for timemodified
Amended to add support for standard restore apply_date_offset().
2016-03-15 23:41:55 +01:00
Ryan Wyllie
ec9e1bec57 MDL-50664 mod_data: tests for 'manageapproved' setting.
Adding test coverage for the 'manageapproved' setting that
was added by Johannes Burk.
2015-09-17 06:18:26 +00:00
Juan Leyva
8352aa50f3 MDL-49937 data: Handle admins/managers in get_databases_by_courses 2015-04-23 09:37:06 +02:00
Juan Leyva
067b3fda6a MDL-49337 webservices: Unit tests for mod_data_get_databases_by_courses 2015-03-24 10:46:36 +01:00