diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec64e43..88990ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,11 +31,11 @@ jobs: fail-fast: false matrix: moodle-branch: ['MOODLE_402_STABLE', 'MOODLE_403_STABLE'] - php: ['8.1'] + php: ['8.2'] database: ['mariadb', 'pgsql'] include: - - php: '8.2' - moodle-branch: 'MOODLE_403_STABLE' + - php: '8.3' + moodle-branch: 'main' database: 'pgsql' steps: @@ -117,9 +117,19 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: chrome + id: behat if: ${{ !cancelled() }} run: moodle-plugin-ci --ansi behat --profile chrome + - name: Upload Behat Faildump + if: ${{ failure() && steps.behat.outcome == 'failure' }} + uses: actions/upload-artifact@v4 + with: + name: Behat Faildump (${{ join(matrix.*, ', ') }}) + path: ${{ github.workspace }}/moodledata/behat_dump + retention-days: 7 + if-no-files-found: ignore + - name: chrome classic if: ${{ !cancelled() }} run: moodle-plugin-ci --ansi behat --suite classic --profile chrome diff --git a/CHANGES.md b/CHANGES.md index 1295818..a1b09ea 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,10 +1,37 @@ -## v4.0.0 (2022-04-19) +## [4.2.2](https://github.com/ewallah/moodle-availability_language/compare/v4.2.1...v4.2.2) (2024-03-13) + +* code review +* PHP 8.3 +* different behat tests for main +* changelogs + +## [4.2.1](https://github.com/ewallah/moodle-availability_language/compare/v4.0.2...v4.2.1) (2024-03-11) + +* master => main +* code review (final test classes) +* iplusacademy icon + +## [4.0.2](https://github.com/ewallah/moodle-availability_language/compare/v4.0.1...v4.0.2) (2023-10-14) + +* MOODLE_403_STABLE +* script always => not canceled +* code review (use /... => use ...) + +## [4.0.1](https://github.com/ewallah/moodle-availability_language/compare/v4.0.0...v4.0.1) (2023-04-23) + +* MOODLE_402_STABLE +* better tests +* better documentation + +## [4.0.0](https://github.com/ewallah/moodle-availability_language/compare/v3.11.1...v4.0.0) (2022-04-19) * MOODLE_400_STABLE * no master language yet * version upgrade -## v3.11.1 (2022-03-10) +## [3.11.1](https://github.com/ewallah/moodle-availability_language/compare/v3.9.9...v3.11.1) (2022-03-10) + +* MOODLE_311_STABLE ## v3.9.9 (2022-03-10) diff --git a/classes/condition.php b/classes/condition.php index c0809b1..d9b9af3 100644 --- a/classes/condition.php +++ b/classes/condition.php @@ -34,7 +34,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class condition extends \core_availability\condition { - /** @var string ID of language that this condition requires, or '' = any language */ protected $languageid; @@ -140,7 +139,7 @@ public function is_available($not, \core_availability\info $info, $grabthelot, $ */ public function get_description($full, $not, \core_availability\info $info) { if ($this->languageid != '') { - $installedlangs = get_string_manager()->get_list_of_translations(false); + $installedlangs = get_string_manager()->get_list_of_translations(); if (array_key_exists($this->languageid, $installedlangs)) { $snot = $not ? 'not' : ''; return get_string('getdescription' . $snot, 'availability_language', $installedlangs[$this->languageid]); diff --git a/classes/frontend.php b/classes/frontend.php index f1109a1..ceca4e2 100644 --- a/classes/frontend.php +++ b/classes/frontend.php @@ -34,7 +34,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class frontend extends \core_availability\frontend { - /** * Additional parameters for the plugin's initInner function. * @@ -46,7 +45,7 @@ class frontend extends \core_availability\frontend { * @return array Array of parameters for the JavaScript function */ protected function get_javascript_init_params($course, \cm_info $cm = null, \section_info $section = null) { - return [self::convert_associative_array_for_js(get_string_manager()->get_list_of_translations(false), 'id', 'name')]; + return [self::convert_associative_array_for_js(get_string_manager()->get_list_of_translations(), 'id', 'name')]; } /** @@ -66,6 +65,6 @@ protected function allow_add($course, \cm_info $cm = null, \section_info $sectio return false; } // If there is only one language installed. - return count(get_string_manager()->get_list_of_translations(false)) > 1; + return count(get_string_manager()->get_list_of_translations()) > 1; } } diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index 4789ceb..87d5305 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -34,7 +34,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class provider implements \core_privacy\local\metadata\null_provider { - /** * Get the language string identifier with the component's language * file to explain why this plugin stores no data. diff --git a/tests/condition_test.php b/tests/condition_test.php index 58fb99e..ef7253a 100755 --- a/tests/condition_test.php +++ b/tests/condition_test.php @@ -38,7 +38,6 @@ * @coversDefaultClass \availability_language */ final class condition_test extends \advanced_testcase { - /** * Load required classes. */ @@ -205,7 +204,7 @@ public function test_get_description(): void { */ public function test_frontend(): void { global $CFG; - require_once($CFG->dirroot.'/mod/lesson/locallib.php'); + require_once($CFG->dirroot . '/mod/lesson/locallib.php'); $this->resetAfterTest(); $this->setAdminUser(); set_config('enableavailability', true); diff --git a/tests/privacy/privacy_test.php b/tests/privacy/privacy_test.php index e44bfa5..49f5392 100644 --- a/tests/privacy/privacy_test.php +++ b/tests/privacy/privacy_test.php @@ -36,7 +36,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ final class privacy_test extends provider_testcase { - /** * Test returning metadata. * @covers \availability_language\privacy\provider