Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 69... Línea 69...
69
    }
69
    }
Línea 70... Línea 70...
70
 
70
 
71
    /**
71
    /**
72
     * Test getting the context for the user ID related to this plugin.
72
     * Test getting the context for the user ID related to this plugin.
73
     */
73
     */
74
    public function test_get_contexts_for_userid() {
74
    public function test_get_contexts_for_userid(): void {
Línea 75... Línea 75...
75
        global $CFG;
75
        global $CFG;
76
 
76
 
77
        // When there are no policies or agreements context list is empty.
77
        // When there are no policies or agreements context list is empty.
Línea 104... Línea 104...
104
    }
104
    }
Línea 105... Línea 105...
105
 
105
 
106
    /**
106
    /**
107
     * Test getting the user IDs within the context related to this plugin.
107
     * Test getting the user IDs within the context related to this plugin.
108
     */
108
     */
109
    public function test_get_users_in_context() {
109
    public function test_get_users_in_context(): void {
110
        global $CFG;
110
        global $CFG;
Línea 111... Línea 111...
111
        $component = 'tool_policy';
111
        $component = 'tool_policy';
112
 
112
 
Línea 183... Línea 183...
183
        $userlist = new \core_privacy\local\request\userlist($parentcontext, $component);
183
        $userlist = new \core_privacy\local\request\userlist($parentcontext, $component);
184
        provider::get_users_in_context($userlist);
184
        provider::get_users_in_context($userlist);
185
        $this->assertCount(0, $userlist);
185
        $this->assertCount(0, $userlist);
186
    }
186
    }
Línea 187... Línea 187...
187
 
187
 
188
    public function test_export_agreements() {
188
    public function test_export_agreements(): void {
Línea 189... Línea 189...
189
        global $CFG;
189
        global $CFG;
190
 
190
 
Línea 244... Línea 244...
244
        $this->assertEquals($this->user->id, $datauser->agreedby);
244
        $this->assertEquals($this->user->id, $datauser->agreedby);
245
        $this->assertEquals(strip_tags($policy2->get('summary')), strip_tags($datauser->summary));
245
        $this->assertEquals(strip_tags($policy2->get('summary')), strip_tags($datauser->summary));
246
        $this->assertEquals(strip_tags($policy2->get('content')), strip_tags($datauser->content));
246
        $this->assertEquals(strip_tags($policy2->get('content')), strip_tags($datauser->content));
247
    }
247
    }
Línea 248... Línea 248...
248
 
248
 
249
    public function test_export_agreements_for_other() {
249
    public function test_export_agreements_for_other(): void {
Línea 250... Línea 250...
250
        global $CFG;
250
        global $CFG;
251
 
251
 
252
        $managercontext = \context_user::instance($this->manager->id);
252
        $managercontext = \context_user::instance($this->manager->id);
Línea 303... Línea 303...
303
        $this->assertEquals($this->manager->id, $datauser->agreedby);
303
        $this->assertEquals($this->manager->id, $datauser->agreedby);
304
        $this->assertEquals(strip_tags($policy2->get('summary')), strip_tags($datauser->summary));
304
        $this->assertEquals(strip_tags($policy2->get('summary')), strip_tags($datauser->summary));
305
        $this->assertEquals(strip_tags($policy2->get('content')), strip_tags($datauser->content));
305
        $this->assertEquals(strip_tags($policy2->get('content')), strip_tags($datauser->content));
306
    }
306
    }
Línea 307... Línea 307...
307
 
307
 
308
    public function test_export_created_policies() {
308
    public function test_export_created_policies(): void {
Línea 309... Línea 309...
309
        global $CFG;
309
        global $CFG;
310
 
310
 
311
        // Create policies and agree to them as manager.
311
        // Create policies and agree to them as manager.