From cf1bcfce182079b477500a5a370a82f91ffe3729 Mon Sep 17 00:00:00 2001 From: Mathew May Date: Fri, 24 Nov 2023 10:23:33 +0800 Subject: [PATCH] MDL-79884 qtype_ordering: Add unit coverage and exemptions Part of: MDL-79863 --- question/type/ordering/lib.php | 2 ++ question/type/ordering/tests/coverage.php | 37 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 question/type/ordering/tests/coverage.php diff --git a/question/type/ordering/lib.php b/question/type/ordering/lib.php index bf6ff52d67d..cad44589c98 100644 --- a/question/type/ordering/lib.php +++ b/question/type/ordering/lib.php @@ -32,6 +32,8 @@ * @param array $args extra arguments * @param bool $forcedownload whether or not force download * @param array $options additional options affecting the file serving + * @codeCoverageIgnore + * This code can not be tested currently as pluginfile() is not testable. */ function qtype_ordering_pluginfile(stdClass $course, stdClass $cm, stdClass $context, string $filearea, array $args, bool $forcedownload, array $options = []) { diff --git a/question/type/ordering/tests/coverage.php b/question/type/ordering/tests/coverage.php new file mode 100644 index 00000000000..d40a9126f94 --- /dev/null +++ b/question/type/ordering/tests/coverage.php @@ -0,0 +1,37 @@ +. + +defined('MOODLE_INTERNAL') || die(); + +/** + * Coverage information for the qtype_ordering subsystem. + * + * @copyright 2023 Mathew May + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +return new class extends phpunit_coverage_info { + /** @var array The list of folders relative to the plugin root to include in coverage generation. */ + protected $includelistfolders = [ + 'backup', + ]; + + /** @var array The list of files relative to the plugin root to include in coverage generation. */ + protected $includelistfiles = [ + 'edit_ordering_form.php', + 'question.php', + 'questiontype.php', + ]; +};