Línea 38... |
Línea 38... |
38 |
class provider_test extends \core_privacy\tests\provider_testcase {
|
38 |
class provider_test extends \core_privacy\tests\provider_testcase {
|
Línea 39... |
Línea 39... |
39 |
|
39 |
|
40 |
/**
|
40 |
/**
|
41 |
* Ensure that export_user_preferences returns no data if the user has not visited the myoverview block.
|
41 |
* Ensure that export_user_preferences returns no data if the user has not visited the myoverview block.
|
42 |
*/
|
42 |
*/
|
43 |
public function test_export_user_preferences_no_pref() {
|
43 |
public function test_export_user_preferences_no_pref(): void {
|
Línea 44... |
Línea 44... |
44 |
$this->resetAfterTest();
|
44 |
$this->resetAfterTest();
|
45 |
|
45 |
|
46 |
$user = $this->getDataGenerator()->create_user();
|
46 |
$user = $this->getDataGenerator()->create_user();
|
Línea 56... |
Línea 56... |
56 |
* @param string $value The value you are storing
|
56 |
* @param string $value The value you are storing
|
57 |
* @param string $expected The expected value override
|
57 |
* @param string $expected The expected value override
|
58 |
*
|
58 |
*
|
59 |
* @dataProvider user_preference_provider
|
59 |
* @dataProvider user_preference_provider
|
60 |
*/
|
60 |
*/
|
61 |
public function test_export_user_preferences($type, $value, $expected) {
|
61 |
public function test_export_user_preferences($type, $value, $expected): void {
|
62 |
$this->resetAfterTest();
|
62 |
$this->resetAfterTest();
|
63 |
$user = $this->getDataGenerator()->create_user();
|
63 |
$user = $this->getDataGenerator()->create_user();
|
64 |
set_user_preference($type, $value, $user);
|
64 |
set_user_preference($type, $value, $user);
|
65 |
provider::export_user_preferences($user->id);
|
65 |
provider::export_user_preferences($user->id);
|
66 |
$writer = writer::with_context(\context_system::instance());
|
66 |
$writer = writer::with_context(\context_system::instance());
|