Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 61... Línea 61...
61
    }
61
    }
Línea 62... Línea 62...
62
 
62
 
63
    /**
63
    /**
64
     * Tests the core_myprofile_navigation() function as an admin viewing a user's course profile.
64
     * Tests the core_myprofile_navigation() function as an admin viewing a user's course profile.
65
     */
65
     */
66
    public function test_core_myprofile_navigation_as_admin() {
66
    public function test_core_myprofile_navigation_as_admin(): void {
67
        $this->setAdminUser();
67
        $this->setAdminUser();
Línea 68... Línea 68...
68
        $iscurrentuser = false;
68
        $iscurrentuser = false;
69
 
69
 
Línea 85... Línea 85...
85
 
85
 
86
    /**
86
    /**
87
     * Tests the core_myprofile_navigation() function as a user without permission to view the full
87
     * Tests the core_myprofile_navigation() function as a user without permission to view the full
88
     * profile of another another user.
88
     * profile of another another user.
89
     */
89
     */
90
    public function test_core_myprofile_navigation_course_without_permission() {
90
    public function test_core_myprofile_navigation_course_without_permission(): void {
91
        // User without permission.
91
        // User without permission.
92
        $this->setUser($this->getDataGenerator()->create_user());
92
        $this->setUser($this->getDataGenerator()->create_user());
Línea 93... Línea 93...
93
        $iscurrentuser = false;
93
        $iscurrentuser = false;
Línea 99... Línea 99...
99
    }
99
    }
Línea 100... Línea 100...
100
 
100
 
101
    /**
101
    /**
102
     * Tests the core_myprofile_navigation() function as the currently logged in user.
102
     * Tests the core_myprofile_navigation() function as the currently logged in user.
103
     */
103
     */
104
    public function test_core_myprofile_navigation_profile_link_as_current_user() {
104
    public function test_core_myprofile_navigation_profile_link_as_current_user(): void {
105
        $this->setUser($this->user);
105
        $this->setUser($this->user);
Línea 106... Línea 106...
106
        $iscurrentuser = true;
106
        $iscurrentuser = true;
107
 
107
 
Línea 112... Línea 112...
112
    }
112
    }
Línea 113... Línea 113...
113
 
113
 
114
    /**
114
    /**
115
     * Tests the core_myprofile_navigation() function as the admin viewing another user.
115
     * Tests the core_myprofile_navigation() function as the admin viewing another user.
116
     */
116
     */
117
    public function test_core_myprofile_navigation_profile_link_as_admin() {
117
    public function test_core_myprofile_navigation_profile_link_as_admin(): void {
118
        $this->setAdminUser();
118
        $this->setAdminUser();
Línea 119... Línea 119...
119
        $iscurrentuser = false;
119
        $iscurrentuser = false;
120
 
120
 
Línea 125... Línea 125...
125
    }
125
    }
Línea 126... Línea 126...
126
 
126
 
127
    /**
127
    /**
128
     * Tests the core_myprofile_navigation() function when viewing the preference page as an admin.
128
     * Tests the core_myprofile_navigation() function when viewing the preference page as an admin.
129
     */
129
     */
130
    public function test_core_myprofile_navigation_preference_as_admin() {
130
    public function test_core_myprofile_navigation_preference_as_admin(): void {
131
        $this->setAdminUser();
131
        $this->setAdminUser();
Línea 132... Línea 132...
132
        $iscurrentuser = false;
132
        $iscurrentuser = false;
133
 
133
 
Línea 140... Línea 140...
140
 
140
 
141
    /**
141
    /**
142
     * Tests the core_myprofile_navigation() function when viewing the preference
142
     * Tests the core_myprofile_navigation() function when viewing the preference
143
     * page as another user without the ability to use the 'loginas' functionality.
143
     * page as another user without the ability to use the 'loginas' functionality.
144
     */
144
     */
145
    public function test_core_myprofile_navigation_preference_without_permission() {
145
    public function test_core_myprofile_navigation_preference_without_permission(): void {
146
        // Login as link for a user who doesn't have the capability to login as.
146
        // Login as link for a user who doesn't have the capability to login as.
147
        $this->setUser($this->getDataGenerator()->create_user());
147
        $this->setUser($this->getDataGenerator()->create_user());
Línea 148... Línea 148...
148
        $iscurrentuser = false;
148
        $iscurrentuser = false;
Línea 154... Línea 154...
154
    }
154
    }
Línea 155... Línea 155...
155
 
155
 
156
    /**
156
    /**
157
     * Tests the core_myprofile_navigation() function as an admin viewing another user's contact details.
157
     * Tests the core_myprofile_navigation() function as an admin viewing another user's contact details.
158
     */
158
     */
159
    public function test_core_myprofile_navigation_contact_fields_as_admin() {
159
    public function test_core_myprofile_navigation_contact_fields_as_admin(): void {
Línea 160... Línea 160...
160
        global $CFG;
160
        global $CFG;
161
 
161
 
162
        // User contact fields.
162
        // User contact fields.
Línea 197... Línea 197...
197
 
197
 
198
    /**
198
    /**
199
     * Tests the core_myprofile_navigation() function as a user viewing another user's profile
199
     * Tests the core_myprofile_navigation() function as a user viewing another user's profile
200
     * ensuring that the contact details are not shown.
200
     * ensuring that the contact details are not shown.
201
     */
201
     */
202
    public function test_core_myprofile_navigation_contact_field_without_permission() {
202
    public function test_core_myprofile_navigation_contact_field_without_permission(): void {
Línea 203... Línea 203...
203
        global $CFG;
203
        global $CFG;
204
 
204
 
205
        $iscurrentuser = false;
205
        $iscurrentuser = false;
Línea 271... Línea 271...
271
 
271
 
272
    /**
272
    /**
273
     * Tests the core_myprofile_navigation() function as an admin viewing another user's
273
     * Tests the core_myprofile_navigation() function as an admin viewing another user's
274
     * profile ensuring the login activity links are shown.
274
     * profile ensuring the login activity links are shown.
275
     */
275
     */
276
    public function test_core_myprofile_navigation_login_activity() {
276
    public function test_core_myprofile_navigation_login_activity(): void {
277
        // First access, last access, last ip.
277
        // First access, last access, last ip.
278
        $this->setAdminUser();
278
        $this->setAdminUser();
Línea 279... Línea 279...
279
        $iscurrentuser = false;
279
        $iscurrentuser = false;
Línea 288... Línea 288...
288
 
288
 
289
    /**
289
    /**
290
     * Tests the core_myprofile_navigation() function as a user viewing another user's profile
290
     * Tests the core_myprofile_navigation() function as a user viewing another user's profile
291
     * ensuring the login activity links are not shown.
291
     * ensuring the login activity links are not shown.
292
     */
292
     */
293
    public function test_core_myprofile_navigationn_login_activity_without_permission() {
293
    public function test_core_myprofile_navigationn_login_activity_without_permission(): void {
294
        // User without permission.
294
        // User without permission.
295
        set_config("hiddenuserfields", "firstaccess,lastaccess,lastip");
295
        set_config("hiddenuserfields", "firstaccess,lastaccess,lastip");
296
        $this->setUser($this->getDataGenerator()->create_user());
296
        $this->setUser($this->getDataGenerator()->create_user());