- init project
git clone https://github.com/era269/movies.git
cd movies
docker-compose up
- run tests
docker exec -it movies_php_1 bin/console doctrine:fixtures:load --env=test
docker exec -it movies_php_1 bin/phpunit
- servce cmmands
docker exec -it movies_php_1 doctrine:database:drop
docker exec -it movies_php_1 doctrine:database:create
docker exec -it movies_php_1 bin/console doctrine:migrations:migrate
docker exec -it movies_php_1 bin/console doctrine:fixtures:load
- add movie:
docker exec -it movies_php_1 bin/console doctrine:fixtures:load
curl -k --location --request POST 'https://localhost/api/v1/movies' \
--header 'Authorization: Basic dGVzdEBlbWFpbC5jb206MQ==' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "The Titanic",
"casts":[
"DiCaprio",
"Kate Winslet"
],
"release_date": "18-01-1998",
"director": "James Cameron",
"ratings": {
"imdb": 7.8,
"rotten_tomatto": 8.2
}
}'
- get movie
curl -k --location --request GET 'https://localhost/api/v1/movies/The%20Titanic' \
--header 'Authorization: Basic dGVzdEBlbWFpbC5jb206MQ==' \
- get movies
curl -k --location --request GET 'https://localhost/api/v1/movies' \
--header 'Authorization: Basic dGVzdEBlbWFpbC5jb206MQ=='