- PHP 7.2.5 or higher
- PDO-SQLite PHP extensions enabled
If you do not already have the symfony binary installed, install it first via https://symfony.com/download.
From the command line:
- Clone the repository in desired location:
git clone [email protected]:katalystsol/simple-jokes.git
- Install the packages (assumes that you have composer installed)
cd simple-jokes
composer install
- Migrate the database tables
php bin/console doctrine:migrations:migrate
- Seed the database with jokes (optional)
php bin/console doctrine:fixtures:load
- Run the server
symfony server:start
- Swagger / OpenAPI doc:
- Postman Collection
- from the command console run if not done during installation:
php bin/console doctrine:fixtures:load
- from the command console run:
symfony server:start
- This will make the API available via http://127.0.0.1:8000 (e.g. go to http://127.0.0.1:8000/api/jokes in browser or Postman)
- basic validation:
- joke must be a minimum of 10 characters
It can be accessed via Curl. For example:
- curl http://127.0.0.1:8000/api/jokes
Or it can be accessed via the browser or using Postman.
Note: the tests have been started but have not been fully implemented.
Run migration and load fixtures
php bin/console doctrine:migrations:migrate --env=test
php bin/console doctrine:fixtures:load --env=test
Run PHPUnit
php bin/phpunit