Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 71... Línea 71...
71
    }
71
    }
Línea 72... Línea 72...
72
 
72
 
73
    /**
73
    /**
74
     * Test report_log_supports_logstore.
74
     * Test report_log_supports_logstore.
75
     */
75
     */
76
    public function test_report_participation_supports_logstore() {
76
    public function test_report_participation_supports_logstore(): void {
77
        $logmanager = get_log_manager();
77
        $logmanager = get_log_manager();
Línea 78... Línea 78...
78
        $allstores = \core_component::get_plugin_list_with_class('logstore', 'log\store');
78
        $allstores = \core_component::get_plugin_list_with_class('logstore', 'log\store');
79
 
79
 
Línea 91... Línea 91...
91
    }
91
    }
Línea 92... Línea 92...
92
 
92
 
93
    /**
93
    /**
94
     * Tests the report_outline_myprofile_navigation() function as an admin user.
94
     * Tests the report_outline_myprofile_navigation() function as an admin user.
95
     */
95
     */
96
    public function test_report_outline_myprofile_navigation() {
96
    public function test_report_outline_myprofile_navigation(): void {
97
        $this->setAdminUser();
97
        $this->setAdminUser();
Línea 98... Línea 98...
98
        $iscurrentuser = false;
98
        $iscurrentuser = false;
99
 
99
 
Línea 105... Línea 105...
105
    }
105
    }
Línea 106... Línea 106...
106
 
106
 
107
    /**
107
    /**
108
     * Tests the report_outline_myprofile_navigation() function as a user without permission.
108
     * Tests the report_outline_myprofile_navigation() function as a user without permission.
109
     */
109
     */
110
    public function test_report_outline_myprofile_navigation_without_permission() {
110
    public function test_report_outline_myprofile_navigation_without_permission(): void {
111
        $this->setUser($this->user);
111
        $this->setUser($this->user);
Línea 112... Línea 112...
112
        $iscurrentuser = true;
112
        $iscurrentuser = true;
113
 
113
 
Línea 119... Línea 119...
119
    }
119
    }
Línea 120... Línea 120...
120
 
120
 
121
    /**
121
    /**
122
     * Test that the current user can not access user report without report/outline:viewuserreport permission.
122
     * Test that the current user can not access user report without report/outline:viewuserreport permission.
123
     */
123
     */
124
    public function test_report_outline_can_not_access_user_report_without_viewuserreport_permission() {
124
    public function test_report_outline_can_not_access_user_report_without_viewuserreport_permission(): void {
125
        $this->getDataGenerator()->role_assign($this->roleid, $this->user->id, $this->coursecontext->id);
125
        $this->getDataGenerator()->role_assign($this->roleid, $this->user->id, $this->coursecontext->id);
Línea 126... Línea 126...
126
        $this->setUser($this->user);
126
        $this->setUser($this->user);
127
 
127
 
Línea 128... Línea 128...
128
        $this->assertFalse(report_outline_can_access_user_report($this->user, $this->course));
128
        $this->assertFalse(report_outline_can_access_user_report($this->user, $this->course));
129
    }
129
    }
130
 
130
 
131
    /**
131
    /**
132
     * Test that the current user can access user report with report/outline:viewuserreport permission.
132
     * Test that the current user can access user report with report/outline:viewuserreport permission.
133
     */
133
     */
134
    public function test_report_outline_can_access_user_report_with_viewuserreport_permission() {
134
    public function test_report_outline_can_access_user_report_with_viewuserreport_permission(): void {
Línea 135... Línea 135...
135
        assign_capability('report/outline:viewuserreport', CAP_ALLOW, $this->roleid, $this->coursecontext->id, true);
135
        assign_capability('report/outline:viewuserreport', CAP_ALLOW, $this->roleid, $this->coursecontext->id, true);