mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-76221 reportbuilder: improve report test generator methods.
Test generators for creating report columns, filters and conditions now allow for setting all persistent properties.
This commit is contained in:
parent
121f5b6300
commit
45818da292
17 changed files with 182 additions and 113 deletions
|
@ -72,16 +72,13 @@ class badges_test extends core_reportbuilder_testcase {
|
|||
$report = $generator->create_report(['name' => 'Badges', 'source' => badges::class, 'default' => 0]);
|
||||
|
||||
// Badge course.
|
||||
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:fullname'])
|
||||
->set_many(['sortenabled' => true, 'sortdirection' => SORT_ASC])->update();
|
||||
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'course:fullname', 'sortenabled' => 1]);
|
||||
|
||||
// Badge name.
|
||||
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'badge:name'])
|
||||
->set_many(['sortenabled' => true, 'sortdirection' => SORT_ASC])->update();
|
||||
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'badge:name', 'sortenabled' => 1]);
|
||||
|
||||
// User fullname.
|
||||
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'user:fullname'])
|
||||
->set_many(['sortenabled' => true, 'sortdirection' => SORT_ASC])->update();
|
||||
$generator->create_column(['reportid' => $report->get('id'), 'uniqueidentifier' => 'user:fullname', 'sortenabled' => 1]);
|
||||
|
||||
$content = $this->get_custom_report_content($report->get('id'));
|
||||
$this->assertCount(3, $content);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue