ndunand / moodle-enrol_attributes

This plugin allows users to be enrolled according to any value stored in their user profile.
https://moodle.org/plugins/enrol_attributes
18 stars 22 forks source link

Failing unit tests #35

Closed mattporritt closed 3 years ago

mattporritt commented 3 years ago

The core Moodle unit test suite fails with this plugin installed due to a missing cachedef language string.

The test that fails: vendor/bin/phpunit "core_cache_administration_helper_testcase" cache/tests/administration_helper_test.php

A patch that fixes the issue:

diff --git a/lang/en/enrol_attributes.php b/lang/en/enrol_attributes.php
index 5ce553a..dbcb585 100644
--- a/lang/en/enrol_attributes.php
+++ b/lang/en/enrol_attributes.php
@@ -22,6 +22,7 @@
  */

 $string['pluginname'] = 'Enrol by user profile fields';
+$string['cachedef_dbquerycache'] = 'DB query cache.';
 $string['defaultrole'] = 'Default role';
 $string['defaultrole_desc'] = 'Default role used to enrol people with this plugin (each instance can override this).';
 $string['attrsyntax'] = 'User profile fields rules';
ndunand commented 3 years ago

Thanks @mattporritt for bringing this up. I have just fixed it as you suggest, and am about to release a new version including this fix.