| Línea 31... |
Línea 31... |
| 31 |
* @package core_reportbuilder
|
31 |
* @package core_reportbuilder
|
| 32 |
* @covers \core_reportbuilder\external\system_report_data_exporter
|
32 |
* @covers \core_reportbuilder\external\system_report_data_exporter
|
| 33 |
* @copyright 2023 Paul Holden <paulh@moodle.com>
|
33 |
* @copyright 2023 Paul Holden <paulh@moodle.com>
|
| 34 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
34 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 35 |
*/
|
35 |
*/
|
| 36 |
class system_report_data_exporter_test extends advanced_testcase {
|
36 |
final class system_report_data_exporter_test extends advanced_testcase {
|
| Línea 37... |
Línea 37... |
| 37 |
|
37 |
|
| 38 |
/**
|
38 |
/**
|
| 39 |
* Test exported data structure
|
39 |
* Test exported data structure
|
| 40 |
*/
|
40 |
*/
|
| Línea 69... |
Línea 69... |
| 69 |
$this->assertCount(1, $export->rows);
|
69 |
$this->assertCount(1, $export->rows);
|
| 70 |
[$name, $source, $tags, $timecreated, $timemodified, $modifiedby] = $export->rows[0]['columns'];
|
70 |
[$name, $source, $tags, $timecreated, $timemodified, $modifiedby] = $export->rows[0]['columns'];
|
| Línea 71... |
Línea 71... |
| 71 |
|
71 |
|
| 72 |
$this->assertStringContainsString('My second report', $name);
|
72 |
$this->assertStringContainsString('My second report', $name);
|
| 73 |
$this->assertEquals(users::get_name(), $source);
|
73 |
$this->assertEquals(users::get_name(), $source);
|
| 74 |
$this->assertEquals('cat, dog', $tags);
|
74 |
$this->assertMatchesRegularExpression('/cat.*dog/', $tags);
|
| 75 |
$this->assertNotEmpty($timecreated);
|
75 |
$this->assertNotEmpty($timecreated);
|
| 76 |
$this->assertNotEmpty($timemodified);
|
76 |
$this->assertNotEmpty($timemodified);
|
| Línea 77... |
Línea 77... |
| 77 |
$this->assertEquals('Admin User', $modifiedby);
|
77 |
$this->assertEquals('Admin User', $modifiedby);
|