Línea 69... |
Línea 69... |
69 |
* @param bool $public
|
69 |
* @param bool $public
|
70 |
* @param bool $expectedispublicvalue
|
70 |
* @param bool $expectedispublicvalue
|
71 |
* @dataProvider createtemplate_form_with_modified_capabilities_provider
|
71 |
* @dataProvider createtemplate_form_with_modified_capabilities_provider
|
72 |
*/
|
72 |
*/
|
73 |
public function test_createtemplate_form_with_modified_capabilities(array $unassignedroles, bool $accessallowed,
|
73 |
public function test_createtemplate_form_with_modified_capabilities(array $unassignedroles, bool $accessallowed,
|
74 |
bool $public = false, bool $expectedispublicvalue = false) {
|
74 |
bool $public = false, bool $expectedispublicvalue = false): void {
|
75 |
global $DB;
|
75 |
global $DB;
|
76 |
[$manager, $teacher, $user, $managerrole, $feedback] = $this->setup_instance();
|
76 |
[$manager, $teacher, $user, $managerrole, $feedback] = $this->setup_instance();
|
77 |
$this->setAdminUser();
|
77 |
$this->setAdminUser();
|
78 |
foreach ($unassignedroles as $role) {
|
78 |
foreach ($unassignedroles as $role) {
|
79 |
unassign_capability($role, $managerrole->id);
|
79 |
unassign_capability($role, $managerrole->id);
|
Línea 132... |
Línea 132... |
132 |
* @param bool $public
|
132 |
* @param bool $public
|
133 |
* @param bool $accessallowed
|
133 |
* @param bool $accessallowed
|
134 |
* @dataProvider createtemplate_form_provider
|
134 |
* @dataProvider createtemplate_form_provider
|
135 |
*/
|
135 |
*/
|
136 |
public function test_createtemplate_form(string $loginas, bool $public,
|
136 |
public function test_createtemplate_form(string $loginas, bool $public,
|
137 |
bool $accessallowed = true) {
|
137 |
bool $accessallowed = true): void {
|
138 |
global $DB;
|
138 |
global $DB;
|
139 |
[$manager, $teacher, $user, $managerrole, $feedback] = $this->setup_instance();
|
139 |
[$manager, $teacher, $user, $managerrole, $feedback] = $this->setup_instance();
|
140 |
switch($loginas) {
|
140 |
switch($loginas) {
|
141 |
case 'admin':
|
141 |
case 'admin':
|
142 |
$this->setAdminUser();
|
142 |
$this->setAdminUser();
|