Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 1.2 KB

readme.md

File metadata and controls

54 lines (34 loc) · 1.2 KB

Laravel TDD with External Database example

An example laravel project using TDD with an external database.

The article on this can be found here.

Installation

Clone this repo

git clone [email protected]:AlanHolmes/tdd-with-external-db-example.git

Boot up the docker container

(skip this step if you aren't using docker)

docker-compose up -d

Env file

  • Copy .env.example to .env
  • Change the DB_* and DB_EXTERNAL_* settings as required

Composer

Run composer install or if don't have the correct version of php (^7.1.3), run it inside the docker container.

docker-compose exec php composer install

Final Step

Run php artisan key:generate to set APP_KEY

Or again, inside the docker container.

docker-compose exec php artisan key:generate

Running Unit Tests

Now that you are all setup, you can run the unit tests within the docker container.

docker-compose exec php php ./vendor/bin/phpunit

License

This example is open-sourced software licensed under the MIT license.