mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-76181' of https://github.com/paulholden/moodle
This commit is contained in:
commit
7202dcb79e
3 changed files with 13 additions and 8 deletions
|
@ -220,10 +220,10 @@ class report {
|
||||||
throw new invalid_parameter_exception('Invalid column');
|
throw new invalid_parameter_exception('Invalid column');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $column
|
return $column->set_many([
|
||||||
->set('sortenabled', $enabled)
|
'sortenabled' => $enabled,
|
||||||
->set('sortdirection', $direction)
|
'sortdirection' => $direction,
|
||||||
->update();
|
])->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -61,7 +61,8 @@ abstract class core_reportbuilder_testcase extends advanced_testcase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stress test a report source by iterating over all it's columns and asserting we can create a report for each
|
* Stress test a report source by iterating over all it's columns, enabling sorting where possible and asserting we can
|
||||||
|
* create a report for each
|
||||||
*
|
*
|
||||||
* @param string $source
|
* @param string $source
|
||||||
*/
|
*/
|
||||||
|
@ -74,10 +75,14 @@ abstract class core_reportbuilder_testcase extends advanced_testcase {
|
||||||
$instance = manager::get_report_from_persistent($report);
|
$instance = manager::get_report_from_persistent($report);
|
||||||
|
|
||||||
// Iterate over each available column, ensure each works correctly independent of any others.
|
// Iterate over each available column, ensure each works correctly independent of any others.
|
||||||
$columnidentifiers = array_keys($instance->get_columns());
|
foreach ($instance->get_columns() as $columnidentifier => $columninstance) {
|
||||||
foreach ($columnidentifiers as $columnidentifier) {
|
|
||||||
$column = report::add_report_column($report->get('id'), $columnidentifier);
|
$column = report::add_report_column($report->get('id'), $columnidentifier);
|
||||||
|
|
||||||
|
// Enable sorting of the column where possible.
|
||||||
|
if ($columninstance->get_is_sortable()) {
|
||||||
|
report::toggle_report_column_sorting($report->get('id'), $column->get('id'), true, SORT_DESC);
|
||||||
|
}
|
||||||
|
|
||||||
// We are only asserting the report returns content without errors, not the content itself.
|
// We are only asserting the report returns content without errors, not the content itself.
|
||||||
try {
|
try {
|
||||||
$content = $this->get_custom_report_content($report->get('id'));
|
$content = $this->get_custom_report_content($report->get('id'));
|
||||||
|
|
|
@ -10,7 +10,7 @@ Information provided here is intended especially for developers.
|
||||||
- `data-force-table` to force table view
|
- `data-force-table` to force table view
|
||||||
* New optional parameter `pagesize` in external method `core_reportbuilder_reports_get` to set the displayed rows per page.
|
* New optional parameter `pagesize` in external method `core_reportbuilder_reports_get` to set the displayed rows per page.
|
||||||
* Javascript reports repository module method `getReport` updated to accept new pagesize parameter.
|
* Javascript reports repository module method `getReport` updated to accept new pagesize parameter.
|
||||||
|
* The `datasource_stress_test_columns` test helper now enables sorting on those columns that support it
|
||||||
|
|
||||||
=== 4.1 ===
|
=== 4.1 ===
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue