Open
Conversation
Add comprehensive tests for previously untested or under-tested classes: - OAuth1\Server: 0% → 100% (getTokenCredentials happy path, MITM check, bad response handling, legacy Guzzle branch, scopes, with, formatScopes) - OAuth1\AbstractProvider: 4% → 83% (user flow, redirect, stateless, scopes/with delegation, setConfig, serviceContainerKey, error paths) - OAuth1\User: 0% → 100% - Config: 90% → 100% (relative URI resolution via URL::to facade) - ConfigTrait: 70% → 100% (getConfig edge cases for falsy values) - ConfigRetriever: 82% → 100% (console spoofing branch, missing guzzle default, missing required keys, additional config keys) - OAuth2\AbstractProvider: 88% → 100% (parseApprovedScopes for array, string, null, numeric, and boolean inputs) - ServiceProvider: added Lumen boot path and register() tests Remaining uncovered lines are dead code (stateful session paths broken with modern Laravel's SymfonySessionDecorator) or require Lumen to be installed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split the test step so PHP 8.5 runs with --coverage-text (prints a coverage summary table in the CI log) and --coverage-clover (generates the Clover XML file for Codecov). Non-coverage runs skip the coverage driver overhead entirely. Also explicitly point the Codecov action to the Clover output file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Switch from xdebug to pcov (faster, lower overhead) and run coverage on all PHP versions instead of only 8.5. Every CI run now prints a coverage summary table in the log. Codecov upload remains on 8.5 only to avoid duplicate reports. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
atymic
requested changes
Mar 22, 2026
Member
atymic
left a comment
There was a problem hiding this comment.
Could you have a quick check of the generated tests are remove the ones testing the internal behaviour?
| use SocialiteProviders\Manager\OAuth1\User; | ||
| use SocialiteProviders\Manager\Test\Stubs\OAuth1ServerStub; | ||
|
|
||
| class TestableOAuth1Provider extends OAuth1AbstractProvider |
Member
There was a problem hiding this comment.
Could we split this out into its own class? Don't like the double classes in one file
| /** | ||
| * @test | ||
| */ | ||
| public function stateless_defaults_to_true_argument(): void |
Member
There was a problem hiding this comment.
do we really need to test stuff like this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OAuth1ServerStubviacreateHttpClient()override, matching the existing OAuth2 test patternCoverage by class
Uncovered lines (14 total)
Dead code — stateful session paths (8 lines):
OAuth1\AbstractProviderlines 94-97 and 163-168 usegetSession()->put()/get(), butSymfonySessionDecoratorin modern Laravel does not exposeput(). The$statelessproperty defaults totrue, making these paths unreachable.Requires Lumen (5 lines):
ServiceProvider:38-39(class_exists('Laravel\Lumen\Application')) andSocialiteWasCalled:61(SOCIALITEPROVIDERS_STATELESSconstant).Constant cannot be toggled (1 line):
OAuth1\AbstractProvider:186-187— onceSOCIALITEPROVIDERS_STATELESSis defined, PHP constants cannot be undefined within a process.Test plan
🤖 Generated with Claude Code