| Línea 37... |
Línea 37... |
| 37 |
* Unit tests for the tool_cohortroles implementation of the privacy API.
|
37 |
* Unit tests for the tool_cohortroles implementation of the privacy API.
|
| 38 |
*
|
38 |
*
|
| 39 |
* @copyright 2018 Zig Tan <zig@moodle.com>
|
39 |
* @copyright 2018 Zig Tan <zig@moodle.com>
|
| 40 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
40 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 41 |
*/
|
41 |
*/
|
| 42 |
class provider_test extends \core_privacy\tests\provider_testcase {
|
42 |
final class provider_test extends \core_privacy\tests\provider_testcase {
|
| Línea 43... |
Línea 43... |
| 43 |
|
43 |
|
| 44 |
/**
|
44 |
/**
|
| 45 |
* Overriding setUp() function to always reset after tests.
|
45 |
* Overriding setUp() function to always reset after tests.
|
| 46 |
*/
|
46 |
*/
|
| - |
|
47 |
public function setUp(): void {
|
| 47 |
public function setUp(): void {
|
48 |
parent::setUp();
|
| 48 |
$this->resetAfterTest(true);
|
49 |
$this->resetAfterTest(true);
|
| Línea 49... |
Línea 50... |
| 49 |
}
|
50 |
}
|
| 50 |
|
51 |
|
| Línea 352... |
Línea 353... |
| 352 |
*
|
353 |
*
|
| 353 |
* @param int $userid The ID of the user used for testing.
|
354 |
* @param int $userid The ID of the user used for testing.
|
| 354 |
* @param int $nocohortroles The number of tool_cohortroles to create for the user.
|
355 |
* @param int $nocohortroles The number of tool_cohortroles to create for the user.
|
| 355 |
* @param string $rolename The name of the role to be created.
|
356 |
* @param string $rolename The name of the role to be created.
|
| 356 |
* @param string $roleshortname The short name of the role to be created.
|
357 |
* @param string $roleshortname The short name of the role to be created.
|
| 357 |
* @throws \core_competency\invalid_persistent_exception
|
358 |
* @throws \core\invalid_persistent_exception
|
| 358 |
* @throws coding_exception
|
359 |
* @throws coding_exception
|
| 359 |
*/
|
360 |
*/
|
| 360 |
protected function setup_test_scenario_data($userid, $context, $nocohortroles, $rolename = 'Sausage Roll',
|
361 |
protected function setup_test_scenario_data($userid, $context, $nocohortroles, $rolename = 'Sausage Roll',
|
| 361 |
$roleshortname = 'sausageroll') {
|
362 |
$roleshortname = 'sausageroll') {
|
| 362 |
$roleid = create_role($rolename, $roleshortname, 'mmmm');
|
363 |
$roleid = create_role($rolename, $roleshortname, 'mmmm');
|