232 Commits

Author SHA1 Message Date
Daniel Ziegenberg
08027e408c
MDL-81281 phpunit: assertObjectHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectHasProperty() instead."

So we replace all instances of assertObjectHasAttribute with
assertObjectHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:45 +01:00
Daniel Ziegenberg
87267da39d
MDL-81281 phpunit: assertObjectNotHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectNotHasProperty() instead."

So we replace all instances of assertObjectNotHasAttribute with
assertObjectNotHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:07 +01:00
Ilya Tregubov
736d102dda Merge branch 'MDL-80550' of https://github.com/paulholden/moodle 2024-03-08 11:05:17 +08:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Ilya Tregubov
a6fd25485e Merge branch 'MDL-80342' of https://github.com/paulholden/moodle 2024-03-07 08:51:25 +08:00
Marina Glancy
d395925a40 MDL-80548 admin: Add bulk user actions also to user list 2024-03-04 12:14:45 +00:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Paul Holden
a16fb194f8
MDL-80550 cohort: get IDs for customfields correctly in external search. 2024-02-23 15:25:15 +00:00
Paul Holden
958090edc6
MDL-80342 reportbuilder: use new cohort filter in related reports. 2024-02-21 16:34:35 +00:00
Paul Holden
ebcc967d2e
MDL-80258 reportbuilder: ensure consistent reporting of entity themes.
Courses, categories, users & cohorts each have a configurable `theme`
attribute - ensure reporting on said value is consistent across all the
corresponding entities.
2024-02-14 12:12:37 +00:00
Paul Holden
c9cdf848bf
MDL-80807 cohort: remove superfluous Behat feature for report source. 2024-02-06 09:48:15 +00:00
Jun Pataleta
83532409cc
Merge branch 'MDL-80725-main-enfix' of https://github.com/mudrd8mz/moodle 2024-02-06 15:59:07 +08:00
David Woloszyn
40d397ab5f MDL-78427 core_theme: Add theme usage report and icon
In addition to adding in theme usage reports, there is also the
addition of an icon on the theme cards which takes you to the report.
This icon only appears for that theme if it has been used in any
overriding context.
2024-02-02 11:16:46 +11:00
David Mudrák
d8ca8be28c MDL-80725 lang: Use the fixed strings in tests, too 2024-01-31 20:06:06 +01:00
David Carrillo
10d2b5864b
MDL-80325 reportbuilder: Update 'Delete' links to red color
- Update all 'Delete' links on RB system report actions to red color
2024-01-12 15:38:19 +01:00
Paul Holden
7143cf4cbc
MDL-79397 reportbuilder: update existing entity table definitions. 2023-12-07 17:19:01 +00:00
Ilya Tregubov
8d7511b230
Merge branch 'MDL-79446' of https://github.com/paulholden/moodle 2023-11-06 09:13:47 +08:00
Paul Holden
28134fe199
MDL-79446 reportbuilder: native support for parameter name suffixes. 2023-11-02 09:27:07 +00:00
Paul Holden
934a851705
MDL-79346 cohort: add "visible" filter/condition to report source.
Add to report as part of default setup.
2023-10-13 10:52:22 +01:00
Paul Holden
db5c663fb9
MDL-76902 course: create categories datasource for custom reporting.
New report source based on the course category entity, joined to the
course, cohort and role assignment/user entities to provide data for
the reportbuilder editor.
2023-08-23 13:42:27 +01:00
Ilya Tregubov
5f7839f06b
MDL-78522 cohort: Fix capability/visibility check. 2023-07-07 15:41:14 +08:00
Paul Holden
05ee8a20a6
MDL-78071 cohort: disable report actions for managed cohorts. 2023-06-19 15:01:14 +01:00
Paul Holden
695fa397f2
MDL-77532 cohort: include custom fields in cohort report entity. 2023-05-19 18:11:50 +01:00
Dmitrii Metelkin
c11d4284be MDL-77130 cohort: add custom fields 2023-04-04 13:01:40 +10:00
Mathew May
e5ca7766e7 MDL-52805 core: Remove legacy log calls 2023-03-07 13:08:46 +08:00
Paul Holden
2f73d7a232 MDL-76611 cohort: prevent duplicate idnumber in inplace editable. 2023-02-13 10:33:23 +00:00
David Matamoros
cf86329c7a MDL-77058 reportbuilder: Fix for cohort null idnumber column 2023-01-27 13:53:44 +01:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
David Mudrák
50ba9dc72c MDL-76739 lang: Use the fixed strings in the tests, too 2023-01-12 09:17:27 +08:00
Marina Glancy
064eccd4fc MDL-75525 reportbuilder: specify initial sorting for datasources 2022-11-07 15:43:45 +01:00
Paul Holden
429508a7b4 MDL-76142 cohort: cross DB support for description filter.
Specifically avoids Oracle exception ORA-00932.
2022-11-01 14:05:39 +00:00
David Matamoros
b0802f49a6 MDL-73141 core_cohort: Convert cohort listing to Report Builder 2022-10-29 12:45:50 +02:00
Paul Holden
b3828cebd2 MDL-75034 reportbuilder: move classes into consistent namespace.
Use `reportbuilder` level two namespace for report related classes
(entities, system reports, etc) within components and sub-systems.
2022-10-07 15:05:34 +01:00
Paul Holden
3c3f6abd43 MDL-74284 cohort: set page title on upload tab.
Override active URL when viewing system/all cohorts for consistent
breadcrumb navigation.
2022-09-20 13:09:11 +01:00
Paul Holden
b40d438fbf MDL-75708 reportbuilder: consider stress tests as requiring longtest.
We should respect the value of the PHPUNIT_LONGTEST constant in the
report source stress tests, as it was discovered after 165e26fa that
the default configuration of some CIs (GHA) was not sufficient to run
them.

Hence, use the PHPUNIT_LONGTEST to determine whether to execute said
tests. Note this constant is enabled on internal CI.
2022-09-09 11:11:39 +01:00
Paul Holden
208adcf3d1 MDL-73938 reportbuilder: better Oracle support of long text columns.
Specifically during column grouping/aggregation, we need to avoid CLOB
datatype inconsistencies (ORA-00932).
2022-09-05 12:08:54 +01:00
Paul Holden
165e26fad9 MDL-73938 reportbuilder: helper methods for automating report tests.
Implement stress tester methods for iterating over report columns,
aggregation and conditions. Assert that each works correctly in
isolation, and when used in conjunction with other columns.
2022-09-05 12:07:17 +01:00
Víctor Déniz
5087f56905 Merge branch 'MDL-75119' of https://github.com/paulholden/moodle 2022-07-19 13:48:58 +01:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Paul Holden
dc60fe6662 MDL-75119 reportbuilder: preload context data for column callbacks.
This prevents additional requests for context instances in the
callback methods, by preloading all required data in the initial
field select.
2022-07-04 13:07:02 +01:00
Sara Arjona
47097ae519 Merge branch 'MDL-74678' of https://github.com/lostrogit/moodle 2022-06-07 17:01:18 +02:00
Paul Holden
40c574cd74 MDL-73988 reportbuilder: support for getting entity joins in reports.
This allow reports using multiple entities to more easily define the
relationship between them, specifically when they share common joined
tables.
2022-05-19 16:35:09 +01:00
Carlos Castillo
0b82e9e9b3 MDL-74678 reportbuilder: Allow null in category description callback
Since category description is a nullable column, we need to allow null
value in category description column callback in category entity
2022-05-13 08:08:37 -05:00
David Matamoros
5e68da7868 MDL-74497 reportbuilder: Use new methods in existing datasources
- Replace all individual calls to add all columns, filters and
conditions on the cohorts datasource with the new
method add_all_from_entities().

- Replace all individual calls to add all columns, filters and
conditions on the courses datasource with the new
method add_all_from_entities().

- Replace all individual calls to add all columns, filters and
conditions on the users datasource with the new
method add_all_from_entity().
2022-05-13 08:36:31 +02:00
Sujith Haridasan
aa1c2e2382 MDL-73848 administration: Fix the breadcrumbs and nav highlights
Create or update the breadcrumbs in the site administration
pages where it is required.
Highlight the corresponding site adminstration tab.
Highlight the primary nav to Site administration when user
is navigating to any of the site administration pages.

Also changed the boostnavbar so that the nodes in the secondary
navigation are not shown in the breadcrumbs when user is in site
administration page.
2022-03-25 17:44:47 +08:00
Paul Holden
b73a69b920 MDL-74175 cohort: correct type/callback of entity category column. 2022-03-15 15:28:54 +00:00
Eloy Lafuente (stronk7)
4003e31983 MDL-73785 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:

- When belonging to other components and being valid api:
  - analytics related tests have been moved to tests/analytics subdir.
  - backup & restore related tests have been moved to tests/backup subdir.
  - events related tests have been moved to tests/event subdir.
  - privacy related tests have been moved to tests/privacy.
  - task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
  needed now that they are namespaced):
  - some xxxlib_test.php have been renamed lib_test.php
    (when they where testing the corresponding lib.php).
  - cache stores tests have been all renamed store_test, originally
    each one had its own name (file_test, apcu_test, redis_test...)
  - assign feedback tests have been all renamed feedback_test, originally
    each one had its own name (file_test, editpdf_test...)
2022-03-03 12:19:30 +01:00
Mihail Geshoski
0cbe8704ee MDL-73169 core_cohort: Update course category breadcrumb nodes 2022-03-02 17:27:38 +08: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)
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