When 2 or more backpack were created without credentials,
a "Duplicate key value violates unique constraint" error
was raised because externalbackpackid was not taking the
correct value.
Other improvements have been done to the code too in order
to make it more readable.
With PHPUnit 8 a good number of assertions, all them related with
operations on non-public attributes have been deprecated. And will
be removed with PHPUnit 9.
The main point is that unit tests shouldn't be testing non-public
APIs (good practice) and those assertions were an error originally.
See https://github.com/sebastianbergmann/phpunit/issues/3338 for
the complete list and other details.
When possible (the attributes being checked are public), the change
is simple, just switching to normal assertions.
When the attributes are not public we need to find a workaround
to be able to test the same using public APIs, or use Reflection,
or remove the tests.
For the records, this is the regexp used to find all the cases:
ag '>(assertAttribute|attribute\(|readAttributte|getStaticAttribute| \
getObjectAttribute)' -G "test.php"
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.
From release notes:https://phpunit.de/announcements/phpunit-8.html
assertInternalType() is deprecated and will be removed in
PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(),
assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(),
assertIsResource(), assertIsString(), assertIsScalar(),
assertIsCallable(), or assertIsIterable() instead.
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.
At the same time, fix a few wrong function names,
provider data and param types, return statements...
In MDL-68746 issuer details fields were removed from the badges
form, because they are filled from the site settings.
This is a regression because these fields should be removed also
from the edit page.
When OBv2.0 support was added, the issuername and issuercontact
fields were changed to static.
In order to avoid confusion for the user, these fields shouldn't
be displayed for OBv2.0 or higher.
This change enables the gherkinlint rule to require a new line at the
end of the file. This change is in keeping with existing Moodle coding
style guidelines.
Mozilla backpack closed a few months ago. It was moved to Badgr.io
(as OBv1.0) but as we're also supporting Badgr.io OBv2.0, it
makes no sense to leave old references to Mozilla backpack there.
This commit combines several changes:
* Show authentication errors.
* Show more detailed authentication errors
* When the site backpack is different to the user backpack, show a warning
* Do not duplicate the apiversion and backpackurls in each user backpack.
* Do not support different issuer information for each badge with Open Badges v2.
* Add obversion to assertion url
* Combine separate badges upgrade steps and bump the version number.
* Don't show private collections.
* Push the larger image size to backpacks (512x512).
* BADGE_BACKPACKURL is deprecated
* Don't use property alignments, only alignment
Upgrade the support for Open Badges 2 to support a real open badges 2 backpack.
Moodle can only talk to one backpack at a time, so after switching backpacks, users
will have to manually disconnect and then reconnect their backpack to the new one.
This commit combines several changes:
* Split classes into badges namespace
* Publish expiry data with a badge
* Publish badge alignments in badges exported to the backpack.
* Export the criteria for a badge to the backpack.
Properly integration badges with competencies provided in Moodle.
Automatically grant the badge when the defined competencies are marked as proficient.
* We need to have unique feature names for our Behat tests.
* I also removed the custom Behat tag @role_visibility as we only allow
Behat tags with the component name in Frankenstyle format.