mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Merge branch 'MDL-62394-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
0697a52218
@ -84,7 +84,7 @@ class moodle_content_writer implements content_writer {
|
||||
public function export_data(array $subcontext, \stdClass $data) : content_writer {
|
||||
$path = $this->get_path($subcontext, 'data.json');
|
||||
|
||||
$this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE));
|
||||
$this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -115,7 +115,7 @@ class moodle_content_writer implements content_writer {
|
||||
];
|
||||
|
||||
$path = $this->get_path($subcontext, 'metadata.json');
|
||||
$this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE));
|
||||
$this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -131,7 +131,7 @@ class moodle_content_writer implements content_writer {
|
||||
public function export_related_data(array $subcontext, $name, $data) : content_writer {
|
||||
$path = $this->get_path($subcontext, "{$name}.json");
|
||||
|
||||
$this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE));
|
||||
$this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -230,7 +230,7 @@ class moodle_content_writer implements content_writer {
|
||||
'value' => $value,
|
||||
'description' => $description,
|
||||
];
|
||||
$this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE));
|
||||
$this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -897,7 +897,7 @@ class moodle_content_writer_test extends advanced_testcase {
|
||||
$contextpath = $this->get_context_path($context, $subcontext, 'metadata.json');
|
||||
|
||||
$json = $fileroot->getChild($contextpath)->getContent();
|
||||
$this->assertRegExp("/$text.*$text.*$text/", $json);
|
||||
$this->assertRegExp("/$text.*$text.*$text/is", $json);
|
||||
|
||||
$expanded = json_decode($json);
|
||||
$this->assertTrue(isset($expanded->$text));
|
||||
@ -950,7 +950,7 @@ class moodle_content_writer_test extends advanced_testcase {
|
||||
$contextpath = $this->get_context_path($context, [get_string('userpreferences')], "{$component}.json");
|
||||
|
||||
$json = $fileroot->getChild($contextpath)->getContent();
|
||||
$this->assertRegExp("/$text.*$text.*$text/", $json);
|
||||
$this->assertRegExp("/$text.*$text.*$text/is", $json);
|
||||
|
||||
$expanded = json_decode($json);
|
||||
$this->assertTrue(isset($expanded->$text));
|
||||
@ -1053,7 +1053,7 @@ class moodle_content_writer_test extends advanced_testcase {
|
||||
$this->assertEquals($expectedpath, $contextpath);
|
||||
|
||||
$json = $fileroot->getChild($contextpath)->getContent();
|
||||
$this->assertRegExp("/$text.*$text.*$text/", $json);
|
||||
$this->assertRegExp("/$text.*$text.*$text/is", $json);
|
||||
|
||||
$expanded = json_decode($json);
|
||||
$this->assertTrue(isset($expanded->$text));
|
||||
@ -1091,7 +1091,7 @@ class moodle_content_writer_test extends advanced_testcase {
|
||||
$this->assertEquals($expectedpath, $contextpath);
|
||||
|
||||
$json = $fileroot->getChild($contextpath)->getContent();
|
||||
$this->assertRegExp("/$text.*$text.*$text/", $json);
|
||||
$this->assertRegExp("/$text.*$text.*$text/is", $json);
|
||||
|
||||
$expanded = json_decode($json);
|
||||
$this->assertTrue(isset($expanded->$text));
|
||||
|
Loading…
x
Reference in New Issue
Block a user