To prevent the debugging messages from appearing during the upgrade,
I set a flag to hide them.
For the test file, I adjusted the parameters in
the unassign_capability() function, which seemed to be using
the parameter intended for assign_capability().
Note: Removing the manual require for the attribute from moodlelib
because the class does not have to exist at time of definition, only
when the Reflection API instantiates an instance in \core\deprecation,
by which point the autoloader is available.
Most params are formally deprecated here. This was originally planned
for MDL-80042, but I realised that having an emit, and final param is a
very useful option going forward.
This patch also moves the is_deprecated(), and related methods to the
\core\deprecated attribute.