-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add tests with coverage #12
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
Conversation
composer.json
Outdated
| "laravel/framework": ">=11.34", | ||
| "lcobucci/jwt": "^5.3" | ||
| "lcobucci/jwt": "^5.3", | ||
| "ext-openssl": "*" |
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.
let's move it to the require-dev key
tests/TestCase.php
Outdated
| public function setUp(): void | ||
| { | ||
| parent::setUp(); | ||
| } | ||
|
|
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.
| public function setUp(): void | |
| { | |
| parent::setUp(); | |
| } |
tests/Support/TokenMockTrait.php
Outdated
| signingKey: InMemory::file(base_path(self::SECRET_KEY_PATH), self::SECRET_KEY_PASS), | ||
| verificationKey: InMemory::file(base_path(self::SIGNER_KEY_PATH)), |
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.
could we use plainText instead?
| signingKey: InMemory::file(base_path(self::SECRET_KEY_PATH), self::SECRET_KEY_PASS), | |
| verificationKey: InMemory::file(base_path(self::SIGNER_KEY_PATH)), | |
| signingKey: InMemory::plainText($signerKeyContent, self::SECRET_KEY_PASS), | |
| verificationKey: InMemory::plainText($verificationKeyContent), |
tests/Support/TokenMockTrait.php
Outdated
| $tokenBuilder = $configJwt->builder() | ||
| ->issuedBy('some_issuer') |
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.
| $tokenBuilder = $configJwt->builder() | |
| ->issuedBy('some_issuer') | |
| $tokenBuilder = $configJwt | |
| ->builder() | |
| ->issuedBy('some_issuer') |
tests/ClerkGuardTest.php
Outdated
| $guard = app(ClerkGuard::class); | ||
|
|
||
| $request = new Request(); | ||
| $request->headers->set('Authorization', "Bearer {$clerkToken}"); | ||
|
|
||
| $guard->setRequest($request); |
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.
| $guard = app(ClerkGuard::class); | |
| $request = new Request(); | |
| $request->headers->set('Authorization', "Bearer {$clerkToken}"); | |
| $guard->setRequest($request); | |
| $request = new Request(); | |
| $request->headers->set('Authorization', "Bearer {$clerkToken}"); | |
| $guard = app(ClerkGuard::class)->setRequest($request); |
tests/ClerkGuardTest.php
Outdated
| ]); | ||
|
|
||
| $clerkToken = $this | ||
| ->createJWTToken('some_user_id') |
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.
let's pass issuer as the second arg, as it not clear to understand why it fail in another test
tests/ClerkGuardTest.php
Outdated
| $request = new Request(); | ||
| $request->headers->set('Authorization', "Bearer {$clerkToken}"); |
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.
let's move it to the helper
| $request = new Request(); | |
| $request->headers->set('Authorization', "Bearer {$clerkToken}"); | |
| $request = $this->generateRequest(['Authorization' => "Bearer {$clerkToken}"]); |
No description provided.