-
Notifications
You must be signed in to change notification settings - Fork 96
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
Refactor and tests for user migration get user route #598
Conversation
@@ -89,27 +89,6 @@ public function tearDown() { | |||
self::$error_log->clear(); | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to tests/testRoutes.php
@@ -0,0 +1,258 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very similar to tests in #595
@@ -0,0 +1,107 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from tests/testRoutesLogin.php
if ( ! $user ) { | ||
$user = get_user_by( 'slug', $username ); | ||
} | ||
|
||
if ( $user instanceof WP_Error ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of unnecessary logic here ...
9c8677a
to
2147f70
Compare
Codecov Report
@@ Coverage Diff @@
## master #598 +/- ##
===========================================
+ Coverage 32.4% 33.3% +0.89%
- Complexity 1309 1312 +3
===========================================
Files 54 54
Lines 4187 4188 +1
===========================================
+ Hits 1357 1395 +38
+ Misses 2830 2793 -37
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, sorry for time taken to review.
Changes
WP_Auth0_Routes::migration_ws_get_user()
for more clear usage; add unit testsWP_Auth0_Routes::error_return_array()
method to handle common failure returnsTesting
Checklist