Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit tests in auth_plugin_test.php #101

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

wo14580
Copy link
Contributor

@wo14580 wo14580 commented Dec 5, 2023

Related to this issue issue 97, a first fix was done by replacing PARAM_URL by PARAM_LOCALURL (commit)

Some of the unit tests were broken because of the entire url redirection.
In this PR I replaced the redirection to google by a local redirection.

To test it:
vendor/bin/phpunit auth/userkey/tests/auth_plugin_test.php

@danmarsden
Copy link
Member

@dmitriim - looks like github actions caught this but the actions config "skipped" a subsequent run and so reported a succesful "skip" rather than a succesful run?

@dmitriim
Copy link
Member

dmitriim commented Dec 5, 2023

yeah. Looks like I missed that. Thanks @wo14580 for providing a fix.


$this->expectException(moodle_exception::class);
$this->expectExceptionMessage('Unsupported redirect to http://google.com detected, execution terminated.');
$this->expectExceptionMessage(
sprintf("Unsupported redirect to %s detected, execution terminated.", SELF::REDIRECTION_PATH)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI doesn't like this line:

 1052 | ERROR   | [x] Must use "self::" for local static member reference; found "SELF::"
      |         |     (Squiz.Classes.SelfMemberReference.IncorrectCase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, it seems normal that it doesn't like it ;-)
I changed it.

@dmitriim dmitriim merged commit 9c9266a into catalyst:MOODLE_33PLUS Dec 6, 2023
3 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants