You need Docker and Docker Compose.
docker-compose up -d
php database/PhoneBookMigration.php
./vendor/bin/phpunit --testsuite Functional
./vendor/bin/phpunit --testsuite Unit
-
URL
/phonebooks/
-
Method:
POST
-
URL Params
Required:
-
Data Params
Required:
firstName=[string]
phoneNumber=[string]
countryCode=[string]
timeZoneName=[string]
Optional:
lastName=[string]
-
Success Response:
- Code: 200
Content:{ message : "Phone book item created successfully!" }
- Code: 200
-
Error Response:
-
Code: 400
Content:{ message : "A phone book item requires: first name, phone number, country code and time zone!" }
-
Code: 400
Content:{ message : "A phone book item requires a phone number valid!" }
-
Code: 400
Content:{ message : "A phone book item requires a country code valid!" }
-
Code: 400
Content:{ message : "A phone book item requires a time zone valid!" }
-
-
URL
/phonebooks/:id
-
Method:
GET
-
URL Params
Required:
id=[integer]
-
Data Params
None
-
Success Response:
- Code: 200
Content:{ id : 1, firstName : "Tony", lastName: "Morella", phoneNumber: "+34623321434", countryCode: 'ES', timeZoneName: "Europe/Madrid", insertedOn: "2019-04-07 14:26:21", updatedOn: "2019-04-07 14:26:21" }
- Code: 200
-
Error Response:
- Code: 404 NOT FOUND
Content:{ message : "Phone book item not found!" }
- Code: 404 NOT FOUND
-
URL
/phonebooks/:id
-
Method:
DELETE
-
URL Params
Required:
id=[integer]
-
Data Params
None
-
Success Response:
- Code: 200
Content:{ message : "Phone book item delete successfully!" }
- Code: 200
-
Error Response:
- Code: 404 NOT FOUND
Content:{ message : "Phone book item not found!" }
- Code: 404 NOT FOUND