Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 159... Línea 159...
159
     * @param int $maxattempts The number of attempts the activity allows (0 = unlimited).
159
     * @param int $maxattempts The number of attempts the activity allows (0 = unlimited).
160
     * @param int|null $status Expected completion status for the rule.
160
     * @param int|null $status Expected completion status for the rule.
161
     * @param string|null $exception Expected exception.
161
     * @param string|null $exception Expected exception.
162
     */
162
     */
163
    public function test_get_state(string $rule, int $rulevalue, array $uservalue, int $maxattempts, ?int $status,
163
    public function test_get_state(string $rule, int $rulevalue, array $uservalue, int $maxattempts, ?int $status,
164
            ?string $exception) {
164
            ?string $exception): void {
165
        global $DB;
165
        global $DB;
Línea 166... Línea 166...
166
 
166
 
167
        if (!is_null($exception)) {
167
        if (!is_null($exception)) {
168
            $this->expectException($exception);
168
            $this->expectException($exception);
Línea 233... Línea 233...
233
    }
233
    }
Línea 234... Línea 234...
234
 
234
 
235
    /**
235
    /**
236
     * Test for get_defined_custom_rules().
236
     * Test for get_defined_custom_rules().
237
     */
237
     */
238
    public function test_get_defined_custom_rules() {
238
    public function test_get_defined_custom_rules(): void {
239
        $expectedrules = [
239
        $expectedrules = [
240
            'completionstatusrequired',
240
            'completionstatusrequired',
241
            'completionscorerequired',
241
            'completionscorerequired',
242
            'completionstatusallscos',
242
            'completionstatusallscos',
Línea 251... Línea 251...
251
    }
251
    }
Línea 252... Línea 252...
252
 
252
 
253
    /**
253
    /**
254
     * Test for get_defined_custom_rule_descriptions().
254
     * Test for get_defined_custom_rule_descriptions().
255
     */
255
     */
256
    public function test_get_custom_rule_descriptions() {
256
    public function test_get_custom_rule_descriptions(): void {
257
        // Get defined custom rules.
257
        // Get defined custom rules.
Línea 258... Línea 258...
258
        $rules = custom_completion::get_defined_custom_rules();
258
        $rules = custom_completion::get_defined_custom_rules();
259
 
259
 
Línea 277... Línea 277...
277
    }
277
    }
Línea 278... Línea 278...
278
 
278
 
279
    /**
279
    /**
280
     * Test for is_defined().
280
     * Test for is_defined().
281
     */
281
     */
282
    public function test_is_defined() {
282
    public function test_is_defined(): void {
283
        // Build a mock cm_info instance.
283
        // Build a mock cm_info instance.
284
        $mockcminfo = $this->getMockBuilder(cm_info::class)
284
        $mockcminfo = $this->getMockBuilder(cm_info::class)
285
            ->disableOriginalConstructor()
285
            ->disableOriginalConstructor()
Línea 351... Línea 351...
351
     *
351
     *
352
     * @dataProvider get_available_custom_rules_provider
352
     * @dataProvider get_available_custom_rules_provider
353
     * @param array $completionrulesvalues
353
     * @param array $completionrulesvalues
354
     * @param array $expected
354
     * @param array $expected
355
     */
355
     */
356
    public function test_get_available_custom_rules(array $completionrulesvalues, array $expected) {
356
    public function test_get_available_custom_rules(array $completionrulesvalues, array $expected): void {
357
        $customcompletionrules = [
357
        $customcompletionrules = [
358
            'customcompletionrules' => $completionrulesvalues,
358
            'customcompletionrules' => $completionrulesvalues,
359
        ];
359
        ];
Línea 360... Línea 360...
360
 
360