From 64e373e9d820b4ee58f52204f43f6a0e7488c3ba Mon Sep 17 00:00:00 2001 From: n_herr03 <nina.herrmann@uni-muenster.de> Date: Thu, 8 Oct 2020 16:02:01 +0200 Subject: [PATCH] added template file for testcases --- tests/filter_test.php | 69 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 tests/filter_test.php diff --git a/tests/filter_test.php b/tests/filter_test.php new file mode 100644 index 0000000..9ac2427 --- /dev/null +++ b/tests/filter_test.php @@ -0,0 +1,69 @@ +<?php +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see <http://www.gnu.org/licenses/>. + +/** + * Tests for filter_opencast. + * + * @package filter_opencast + * @category test + * @copyright 2020 Nina Herrmann + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +global $CFG; +require_once($CFG->dirroot . '/filter/opencast/filter.php'); + +/** + * Unit tests for Opencast filter. + * + * The Filter displays the data given from the repository opencast to an iFrame + * + * @package filter_opencast + * @category test + * @copyright 2020 Nina Herrmann WWU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class filter_opencast_testcase extends advanced_testcase { + + /** @var object The filter plugin object to perform the tests on */ + protected $filter; + + /** + * Setup the test framework + * + * @return void + */ + protected function setUp() { + parent::setUp(); + $this->resetAfterTest(true); + $this->filter = new filter_opencast(context_system::instance(), array()); + } + + /** + * Perform the actual tests, once the unit test is set up. + * + * @return void + */ + public function test_filter_opencast() { + global $CFG; + + $filter = new filter_opencast; + $string = $filter->filter('www.some.de/url/'); + $this->assertEquals('', ''); + } +} -- GitLab