A lumen RESTful API which provides methods for storing, categorising and retrieving Movie information.
The docker container can be started by running following from project root:
./run.sh
The docker container listens on http://localhost:8000
Following requirements for developing on Debian Jessie 8.9:
- php7.1
- php7.1-xdebug
- php7.1-xml
- php7.1-mbstring
- php7.1-mysql (if using MySQL database)
- curl
- composer
Copy .env.example and set environment variables as per development environment:
cp .env.example .env
Don't forget to create a database with the database name specified in .env
To setup development environment run:
composer install
php artisan doctrine:migrations:migrate
php artisan doctrine:generate:proxies
Database can be seeded by running:
php artisan db:seed --class=Uma\\Database\\Seeds\\DatabaseSeeder
The seeded user is:
username: apitest
password: password123
Documentation can be generated using the swagger-php plugin:
./vendor/bin/swagger -o docs/ src/
The output swagger.json
file can be found in docs/
.
Running unit + component + integration tests can be done from project root with:
./vendor/bin/phpunit
API tests can be found in (to see examples of testing lumen controllers):
tests/Infrastructure/Http/Controllers/
Note: index tests will fail if database has been seeded - database needs to be emptied before running tests