Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 84... Línea 84...
84
    }
84
    }
Línea 85... Línea 85...
85
 
85
 
86
    /**
86
    /**
87
     * Test exception if try to get an image for non existing course.
87
     * Test exception if try to get an image for non existing course.
88
     */
88
     */
89
    public function test_getting_data_if_course_is_not_exist() {
89
    public function test_getting_data_if_course_is_not_exist(): void {
90
        $this->expectException('dml_missing_record_exception');
90
        $this->expectException('dml_missing_record_exception');
91
        $this->expectExceptionMessageMatches("/Can't find data record in database table course./");
91
        $this->expectExceptionMessageMatches("/Can't find data record in database table course./");
92
        $this->assertFalse(\cache::make('core', 'course_image')->get(999));
92
        $this->assertFalse(\cache::make('core', 'course_image')->get(999));
Línea 93... Línea 93...
93
    }
93
    }
94
 
94
 
95
    /**
95
    /**
96
     * Test get_image_url_from_overview_files when no summary files in the course.
96
     * Test get_image_url_from_overview_files when no summary files in the course.
97
     */
97
     */
98
    public function test_get_image_url_from_overview_files_return_null_if_no_summary_files_in_the_course() {
98
    public function test_get_image_url_from_overview_files_return_null_if_no_summary_files_in_the_course(): void {
Línea 99... Línea 99...
99
        $method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
99
        $method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
100
        $cache = course_image::get_instance_for_cache(new cache_definition());
100
        $cache = course_image::get_instance_for_cache(new cache_definition());
Línea 105... Línea 105...
105
    }
105
    }
Línea 106... Línea 106...
106
 
106
 
107
    /**
107
    /**
108
     * Test get_image_url_from_overview_files when no summary images in the course.
108
     * Test get_image_url_from_overview_files when no summary images in the course.
109
     */
109
     */
110
    public function test_get_image_url_from_overview_files_returns_null_if_no_summary_images_in_the_course() {
110
    public function test_get_image_url_from_overview_files_returns_null_if_no_summary_images_in_the_course(): void {
111
        $method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
111
        $method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
Línea 112... Línea 112...
112
        $cache = course_image::get_instance_for_cache(new cache_definition());
112
        $cache = course_image::get_instance_for_cache(new cache_definition());
113
 
113
 
Línea 118... Línea 118...
118
    }
118
    }
Línea 119... Línea 119...
119
 
119
 
120
    /**
120
    /**
121
     * Test get_image_url_from_overview_files when no summary images in the course.
121
     * Test get_image_url_from_overview_files when no summary images in the course.
122
     */
122
     */
123
    public function test_get_image_url_from_overview_files_returns_url_if_there_is_a_summary_image() {
123
    public function test_get_image_url_from_overview_files_returns_url_if_there_is_a_summary_image(): void {
124
        $method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
124
        $method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
Línea 125... Línea 125...
125
        $cache = course_image::get_instance_for_cache(new cache_definition());
125
        $cache = course_image::get_instance_for_cache(new cache_definition());
126
 
126
 
Línea 132... Línea 132...
132
    }
132
    }
Línea 133... Línea 133...
133
 
133
 
134
    /**
134
    /**
135
     * Test get_image_url_from_overview_files when several summary images in the course.
135
     * Test get_image_url_from_overview_files when several summary images in the course.
136
     */
136
     */
137
    public function test_get_image_url_from_overview_files_returns_url_of_the_first_image_if_there_are_many_summary_images() {
137
    public function test_get_image_url_from_overview_files_returns_url_of_the_first_image_if_there_are_many_summary_images(): void {
138
        $method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
138
        $method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
Línea 139... Línea 139...
139
        $cache = course_image::get_instance_for_cache(new cache_definition());
139
        $cache = course_image::get_instance_for_cache(new cache_definition());
140
 
140
 
Línea 150... Línea 150...
150
    }
150
    }
Línea 151... Línea 151...
151
 
151
 
152
    /**
152
    /**
153
     * Test get_image_url_from_overview_files when several summary files in the course.
153
     * Test get_image_url_from_overview_files when several summary files in the course.
154
     */
154
     */
155
    public function test_get_image_url_from_overview_files_returns_url_of_the_first_image_if_there_are_many_summary_files() {
155
    public function test_get_image_url_from_overview_files_returns_url_of_the_first_image_if_there_are_many_summary_files(): void {
156
        $method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
156
        $method = new ReflectionMethod(course_image::class, 'get_image_url_from_overview_files');
Línea 157... Línea 157...
157
        $cache = course_image::get_instance_for_cache(new cache_definition());
157
        $cache = course_image::get_instance_for_cache(new cache_definition());
158
 
158