Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 31... Línea 31...
31
/**
31
/**
32
 * Unit tests for the `icon_system` class.
32
 * Unit tests for the `icon_system` class.
33
 *
33
 *
34
 * @coversDefaultClass \core\output\icon_system
34
 * @coversDefaultClass \core\output\icon_system
35
 */
35
 */
36
class icon_system_test extends advanced_testcase {
36
final class icon_system_test extends advanced_testcase {
37
    /**
37
    /**
38
     * Check whether the supplied classes are valid icon subsystems of the supplied one.
38
     * Check whether the supplied classes are valid icon subsystems of the supplied one.
39
     *
39
     *
40
     * @covers ::is_valid_system
40
     * @covers ::is_valid_system
41
     * @dataProvider is_valid_subsystem_provider
41
     * @dataProvider is_valid_subsystem_provider
Línea 158... Línea 158...
158
     * - child icon system
158
     * - child icon system
159
     * - whether it is a valid child
159
     * - whether it is a valid child
160
     *
160
     *
161
     * @return array
161
     * @return array
162
     */
162
     */
163
    public function icon_system_provider(): array {
163
    public static function icon_system_provider(): array {
164
        return [
164
        return [
165
            'icon_system => icon_system_standard' => [
165
            'icon_system => icon_system_standard' => [
166
                icon_system::class,
166
                icon_system::class,
167
                icon_system_standard::class,
167
                icon_system_standard::class,
168
                true,
168
                true,
Línea 209... Línea 209...
209
    /**
209
    /**
210
     * Data provider for tests of `is_valid`.
210
     * Data provider for tests of `is_valid`.
211
     *
211
     *
212
     * @return array
212
     * @return array
213
     */
213
     */
214
    public function is_valid_subsystem_provider(): array {
214
    public static function is_valid_subsystem_provider(): array {
215
        return $this->icon_system_provider();
215
        return self::icon_system_provider();
216
    }
216
    }
Línea 217... Línea 217...
217
 
217
 
218
    /**
218
    /**
219
     * Data provider for tests of `instance` containing only invalid tests.
219
     * Data provider for tests of `instance` containing only invalid tests.
220
     *
220
     *
221
     * @return array
221
     * @return array
222
     */
222
     */
223
    public function invalid_instance_provider(): array {
223
    public static function invalid_instance_provider(): array {
224
        return array_filter(
224
        return array_filter(
225
            $this->icon_system_provider(),
225
            self::icon_system_provider(),
226
            function($data) {
226
            function($data) {
227
                return !$data[2];
227
                return !$data[2];
228
            },
228
            },
229
            ARRAY_FILTER_USE_BOTH
229
            ARRAY_FILTER_USE_BOTH
Línea 233... Línea 233...
233
    /**
233
    /**
234
     * Data provider for tests of `instance` containing only valid tests.
234
     * Data provider for tests of `instance` containing only valid tests.
235
     *
235
     *
236
     * @return array
236
     * @return array
237
     */
237
     */
238
    public function valid_instance_provider(): array {
238
    public static function valid_instance_provider(): array {
239
        return array_filter(
239
        return array_filter(
240
            $this->icon_system_provider(),
240
            self::icon_system_provider(),
241
            function($data) {
241
            function($data) {
242
                return $data[2];
242
                return $data[2];
243
            },
243
            },
244
            ARRAY_FILTER_USE_BOTH
244
            ARRAY_FILTER_USE_BOTH
245
        );
245
        );