diff --git a/lib/tests/antivirus_test.php b/lib/tests/antivirus_test.php new file mode 100644 index 00000000000..13320e9cfc3 --- /dev/null +++ b/lib/tests/antivirus_test.php @@ -0,0 +1,37 @@ +. + +/** + * Tests for antivirus manager. + * + * @package core_antivirus + * @category phpunit + * @copyright 2016 Ruslan Kabalin, Lancaster University. + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +class core_antivirus_testcase extends advanced_testcase { + + public function test_manager_get_antivirus() { + // We are using clamav plugin in the test, + // as the only plugin we know exists for sure. + $antivirusviaget = \core\antivirus\manager::get_antivirus('clamav'); + $antivirusdirect = new \antivirus_clamav\scanner(); + $this->assertEquals($antivirusdirect, $antivirusviaget); + } +}