Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 26... Línea 26...
26
 *
26
 *
27
 * @package availability_completion
27
 * @package availability_completion
28
 * @copyright 2014 The Open University
28
 * @copyright 2014 The Open University
29
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
30
 */
30
 */
31
class condition_test extends \advanced_testcase {
31
final class condition_test extends \advanced_testcase {
Línea 32... Línea 32...
32
 
32
 
33
    /**
33
    /**
34
     * Setup to ensure that fixtures are loaded.
34
     * Setup to ensure that fixtures are loaded.
35
     */
35
     */
Línea 43... Línea 43...
43
 
43
 
44
    /**
44
    /**
45
     * Load required classes.
45
     * Load required classes.
46
     */
46
     */
-
 
47
    public function setUp(): void {
47
    public function setUp(): void {
48
        parent::setUp();
48
        condition::wipe_static_cache();
49
        condition::wipe_static_cache();
Línea 49... Línea 50...
49
    }
50
    }
50
 
51
 
Línea 467... Línea 468...
467
        $information = $cond->get_description(false, false, $info);
468
        $information = $cond->get_description(false, false, $info);
468
        $information = \core_availability\info::format_info($information, $course);
469
        $information = \core_availability\info::format_info($information, $course);
469
        $this->assertMatchesRegularExpression($description, $information);
470
        $this->assertMatchesRegularExpression($description, $information);
470
    }
471
    }
Línea 471... Línea 472...
471
 
472
 
472
    public function previous_activity_data(): array {
473
    public static function previous_activity_data(): array {
473
        // Assign grade, condition, activity to complete, activity to test, result, resultnot, description.
474
        // Assign grade, condition, activity to complete, activity to test, result, resultnot, description.
474
        return [
475
        return [
475
            'Missing previous activity complete' => [
476
            'Missing previous activity complete' => [
476
                0, COMPLETION_COMPLETE, '', 'page1', false, false, '~Missing activity.*is marked complete~'
477
                0, COMPLETION_COMPLETE, '', 'page1', false, false, '~Missing activity.*is marked complete~'
Línea 632... Línea 633...
632
        $information = \core_availability\info::format_info($information, $course);
633
        $information = \core_availability\info::format_info($information, $course);
633
        $this->assertMatchesRegularExpression($description, $information);
634
        $this->assertMatchesRegularExpression($description, $information);
Línea 634... Línea 635...
634
 
635
 
Línea 635... Línea 636...
635
    }
636
    }
636
 
637
 
637
    public function section_previous_activity_data(): array {
638
    public static function section_previous_activity_data(): array {
638
        return [
639
        return [
639
            // Condition, Activity completion, section to test, result, resultnot, description.
640
            // Condition, Activity completion, section to test, result, resultnot, description.
640
            'Completion complete Section with no previous activity' => [
641
            'Completion complete Section with no previous activity' => [