Setting up Laravel 12 testing (PHPUnit + Pest) and writing tests for JWT authorization
There is a ready Laravel 12 project deployed in Docker. On the frontend — Nuxt.js, all authorization and logic work through API (Tymon JWT). It is necessary to configure parallel execution of PHPUnit and Pest in PhpStorm and write tests for JWT authorization (login via form and via API). Small code adjustments are allowed if needed for tests to pass.
Tasks
Environment configuration for tests in PhpStorm (on the client side)
Ensure that both PHPUnit and Pest are available in the Docker container.
Set up two run configurations in PhpStorm:
PHPUnit
Pest
Configure so that both test sets can be run in parallel (simultaneously) from PhpStorm.
Prepare and provide configuration files/templates for PhpStorm (Run/Debug Configurations) to run PHPUnit and Pest.
Writing tests for JWT authorization
Test via web form:
Open the page
/login(or your form route).Send valid user credentials.
Ensure that after successful login, the server returns a correct JWT token (in cookies or in header).
Check that the user is automatically redirected (or receives a response) to the protected route.
API tests (Pest or PHPUnit):
POST /api/auth/loginwith real user data → response containstokenfield and status 200.Using the obtained JWT, make a request to the protected
GET /api/user(or similar route) → status 200 and user data returned.Attempt to access the same API without a token → status 401.
Attempt to login with incorrect password → status 422 (or 401, depending on settings).
If necessary — code adjustments
If JWT authorization in controllers or middleware is configured non-standardly, make minimal adjustments (for example, specify the correct guard, token field name, avoid unnecessary redirects).
Pay attention to the configuration of
config/auth.phpandconfig/jwt.php(adjust if necessary).Review the entire project code and provide recommendations for improving architecture, readability, and security.
Requirements for the contractor
Confident experience with Laravel 12, Docker environment, and PhpStorm.
Knowledge of Pest and PHPUnit: installation, configuration, running in IDE.
Experience testing JWT authorization (Tymon JWT).
Skill in editing Laravel code for correct test operation (middleware, guards).
Understanding how to test HTTP controllers and API routes.
Materials and accesses
Link to Git repository (access will be provided after agreement).
Docker Compose file with current environment.
File
composer.jsonwith dependencies (Pest, tymon/jwt-auth, etc.).List of routes for login and API (for example,
/login,/api/auth/login,/api/user).
-
Vladyslav Freelancehunt
Костянтине, будь ласка, додайте до опису саме посилання на вебсайт, а також вкажіть які сервіси використовуються для його обслуговування.
-
Current freelance projects in the category PHP
Write meta data for ALT using AIA website on Laravel, the site has many images for which it is necessary to automatically generate correct semantic and relevant ALT descriptions for the images, with the possibility of verification. AI & Machine Learning, PHP ∙ 5 hours 32 minutes back ∙ 19 proposals |
Completion of the website on Ocstore 3
16 USD
Ocstore 3 Template Upstore Fix some issues https://docs.google.com/document/d/1-TmTo3lh_ElFjPMQCGs2sVCsVSzq-V-Z/edit?usp=sharing&ouid=105344407605205919725&rtpof=true&sd=true I look forward to your proposals PHP, Web Programming ∙ 9 hours 12 minutes back ∙ 53 proposals |
A developer is needed to complete and integrate a project for automatic data collection and processing.
16 USD
The main part of the parser has already been implemented. The parser works in a Windows environment through Microsoft Edge: the site has anti-bot protection, so data collection is performed not through direct HTTP requests, but through a live browser session. The scripts control… PHP, Web Programming ∙ 11 hours 28 minutes back ∙ 19 proposals |
Updating plugins and themes for the WP site putevka.uz"A technical audit of the WordPress site needs to be conducted, checking the relevance, security, and compatibility of the installed plugins and theme. Based on the results, legal options for updating, replacing outdated solutions, or transitioning to officially available… HTML & CSS, PHP ∙ 14 hours 5 minutes back ∙ 33 proposals |
Integration of the "Where to Watch" block (Laravel / Livewire)It is necessary to implement the integration of an external streaming platform for a website about movies and series on Laravel / Livewire. What needs to be done: Implement the import of an external content catalog that is updated once a day. Match content by IMDb ID and/or TMDB… PHP, Web Programming ∙ 1 day 4 hours back ∙ 36 proposals |