Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rizkytegar/laravel-phpunittest-example
This project is a Laravel application used to perform API testing against the reqres.in endpoints.
https://github.com/rizkytegar/laravel-phpunittest-example
laravel phpunit reqres-api unit-testing
Last synced: about 1 month ago
JSON representation
This project is a Laravel application used to perform API testing against the reqres.in endpoints.
- Host: GitHub
- URL: https://github.com/rizkytegar/laravel-phpunittest-example
- Owner: rizkytegar
- Created: 2024-09-13T06:56:18.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-20T09:41:27.000Z (4 months ago)
- Last Synced: 2024-09-26T21:40:30.290Z (4 months ago)
- Topics: laravel, phpunit, reqres-api, unit-testing
- Language: PHP
- Homepage:
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laravel API Testing with Reqres.in
## Description
This project is a Laravel application used to perform API testing against the `reqres.in` endpoints. `reqres.in` is a dummy API service providing sample data for testing and development purposes. This project utilizes unit tests to validate various types of API requests, including GET, POST, PUT, and DELETE.
## Features
- **GET Request:** Fetch a list of users and a single user.
- **POST Request:** Create a new user.
- **PUT Request:** Update an existing user's information.
- **DELETE Request:** Delete a user by ID.## Code Structure
- **tests/Feature/ApiTest.php:** Contains unit tests for testing `reqres.in` endpoints. The test cases include:
- `test_get_users_request()`: Tests the endpoint for fetching a list of users.
- `test_get_single_user_request()`: Tests the endpoint for fetching a single user.
- `test_post_request()`: Tests the endpoint for creating a new user.
- `test_put_request()`: Tests the endpoint for updating an existing user.
- `test_delete_request()`: Tests the endpoint for deleting a user.