Skip to content

jaroslawziolkowski/laravel54apitestapp

Repository files navigation

Test task to share API

Requirements

  • PHP >= 5.6.4
  • MySQL 5.x
  • composer
  • terminal access
  • git

Installation

  • Please get repository to your local computer
$ git clone
  • You need to configure you web server. Root directory for your domain should be applicationDirectory/public
  • If you need use apache, you need to enable mod_rewrite

with configured PHP >=5.6

  • Move file /.env.example to /.env. You need to only set there MySQL access data and set APP_KEY for example
APP_KEY=base64:5Y7w1INxwOtpA3vhW50FO743j9YrMOxXO+hKPtc4jbo=

  • in project home directory run
  • sub-directories in /storage must be writable
$ composer update
  • in same directory run
$ php artisan migrate

Using

  • Run unit test In app directory run
$ vendor/bin/phpunit tests

For all requests required is plain JSON as parameters.

  • User Create (postman example)
HEADERS:
X-Requested-With:XMLHttpRequest
Content-Type: application/json

POST /api/user/create

Response is JSON object with data or errors

  • User edit
HEADERS:
X-Requested-With:XMLHttpRequest
Content-Type: application/json

PUT /api/user/edit

Response is integer grated than 1 or errors

  • Create deposit
HEADERS:
X-Requested-With:XMLHttpRequest
Content-Type: application/json

POST /api/banking/deposit

Response is JSON object with data or errors

  • Create withdraw
HEADERS:
X-Requested-With:XMLHttpRequest
Content-Type: application/json

POST /api/banking/withdraw

Response is JSON object with data or errors

  • Report
HEADERS:
X-Requested-With:XMLHttpRequest
Content-Type: application/json

POST /api/report

Response is JSON object with data or errors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published