diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..c96e1b70b27eb398f5cebcc7a5d9d26928cc8d0f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,83 @@ +language: php +os: linux +dist: xenial + +cache: + directories: + - $HOME/.composer/cache + - $HOME/.npm + +addons: + postgresql: "9.6" + +services: + - mysql + - docker + +php: + - 7.2 + - 7.3 + - 7.4 + +env: + jobs: + - DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE + - DB=pgsql MOODLE_BRANCH=MOODLE_38_STABLE + - DB=pgsql MOODLE_BRANCH=MOODLE_39_STABLE + - DB=pgsql MOODLE_BRANCH=master + - DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE + - DB=mysqli MOODLE_BRANCH=MOODLE_38_STABLE + - DB=mysqli MOODLE_BRANCH=MOODLE_39_STABLE + - DB=mysqli MOODLE_BRANCH=master + +before_install: + - phpenv config-rm xdebug.ini + - cd ../.. + - composer selfupdate + - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3 + - export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH" + - moodle-plugin-ci add-plugin Opencast-Moodle/moodle-block_opencast + - moodle-plugin-ci add-plugin Opencast-Moodle/moodle-tool_opencast + +jobs: + fast_finish: true + include: + # Prechecks against latest Moodle stable only. + - stage: static + php: 7.4 + env: DB=mysqli MOODLE_BRANCH=MOODLE_39_STABLE + install: + - moodle-plugin-ci install --no-init + script: + - moodle-plugin-ci phplint + - moodle-plugin-ci phpcpd + - moodle-plugin-ci phpmd + - moodle-plugin-ci phpdoc + - moodle-plugin-ci codechecker + - moodle-plugin-ci savepoints + - moodle-plugin-ci mustache + - moodle-plugin-ci grunt + - moodle-plugin-ci validate + # Smaller build matrix for development builds + - stage: develop + php: 7.4 + env: DB=mysqli MOODLE_BRANCH=MOODLE_39_STABLE + exclude: + - php: 7.4 + env: DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE + - php: 7.4 + env: DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE + +# Unit tests and behat tests against full matrix. +install: + - moodle-plugin-ci install +script: + - moodle-plugin-ci phpunit --coverage-clover + - moodle-plugin-ci behat --profile chrome + +stages: + - static + - name: develop + if: branch != master AND (type != pull_request OR head_branch != master) AND (tag IS blank) + - name: test + if: branch = master OR (type = pull_request AND head_branch = master) OR (tag IS present) diff --git a/README.md b/README.md index a5dcc65bc1f8f365ddb5e5e1cff1848820656fc5..53eaa2864fe92ea33165e7c69a1fd229abe9d846 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # moodle-filter_opencastfilter -The opencast filter can be used to embed opencast videos using opencast players such as Paella or Theodul. +The opencast filter can be used to embed opencast videos. Tested opencast players are Paella or Theodul. If you find other players, please contact us to enhance the list. The filter takes in the html pasted by the opencast repository and replaces it by an iframe, which serves an opencast player with the respective opencast event. The filter itself has no influence on the embedded content, but simply takes the information created by the repository. Look into the documentation of [repository_opencast](https://github.com/unirz-tu-ilmenau/moodle-repository_opencast) for details on that. diff --git a/tests/filter_test.php b/tests/filter_test.php new file mode 100644 index 0000000000000000000000000000000000000000..9ac2427a8c4a65af4bd52e91c9cd19f7ca6009fd --- /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('', ''); + } +} diff --git a/version.php b/version.php index b7dc689e8b89362e6c1bc91330944dafc1bf2e7f..7b9ea634a49967509d8d5a34476bd341dfbf33f3 100644 --- a/version.php +++ b/version.php @@ -19,12 +19,17 @@ * * @package filter * @subpackage opencastfilter - * @copyright 2018 Tamara Gunkel + * @copyright 2018 Tamara Gunkel, 2020 Nina Herrmann * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); +$plugin->maturity = MATURITY_RC; $plugin->version = 2018031902; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2017050500; // Requires this Moodle version. -$plugin->component = 'filter_opencast'; // Full name of the plugin. \ No newline at end of file +$plugin->component = 'filter_opencast'; // Full name of the plugin. +$plugin->dependencies = array( + 'block_opencast' => 2019052900, // Requires Block Opencast and Tool Opencast + 'tool_opencast' => 2018102900, +); \ No newline at end of file