-
Bug
-
Resolution: Fixed
-
Blocker
-
3.3.5
-
MOODLE_33_STABLE
-
MOODLE_33_STABLE
-
- Run unit tests for privacy/tests/sitepolicy_test.php under PHP 5.6.
- Check that no strict standard warning is raised.
As reported by tobias.reischmann at https://moodle.org/local/chatlogs/index.php?conversationid=21752#c638360
It seems that the new privacy changes in core created some "regressions" for moodle3.3 in combination with php5.6 and behat. privacy/classes/local/sitepolicy/handler.php uses abstract static functions, which are not allowed in php5.6 and cause a warning. This warning is handled within behat tests as exception. Thus the very common behat step 'And I log in as "teacher"' is no longer working. Do we bother about something like that?
Moodle core has zero notice tolerance policy so as per suggestion by dobedobedoh this is a blocker.
Making these methods abstract was based on the following suggestion raised during the integration review:
In the abstract class 'handler', where you have a couple of methods defined and returning null, I can't see any case where we're relying on that base implementation. It seems to me we always want the extending class to implement these methods. Therefore, I think these should just be proper abstract methods. This way, we force the extending classes to provide implementations, rather than suggest.
To fulfill that suggestion while keeping this compatible with PHP 5.6, I propose to remove the abstract keyword from methods and making them throw coding exceptions, so that implementations are forced to provide them.