You can setup this sample use Laradock to automatically set up a development environment for you.
- Install docker and docker-compose
- Clone repo
- Create your .env file from the example file:
cp .env.testing .env
- Go to the
laradock
directory - Run
docker-compose up -d nginx mysql workspace
- Browse to http://localhost/
To SSH into the machine to run your tests, run docker exec -it laradock_workspace_1 /bin/bash
.
Run Codeception, installed via Composer
./vendor/bin/codecept build
./vendor/bin/codecept run
Please check out some good test examples provided.
Demonstrates testing of CRUD application with
- PageObjects
- authentication (by user, credentials, http auth)
- usage of session variables
- routes
- creating and checking records in database
- testing of form errors
Demonstrates functional testing of API using REST and Laravel5 modules connected, with
- partial json inclusion in response
- GET/POST/PUT/DELETE requests
- check changes inside database