Run
My tests require SQLite
. Let’s install it first:
sudo apt-get install php-sqlite3
Now we can run tests with:
./vendor/bin/phpunit
Automate
We can use a utility called pywatch
to run a command when files are changed. Here’s how we create a new Laravel project and run unit tests automatically when they’re updated:
cd ~/Sites
composer create project laravel/laravel docker-testing
cd docker-testing
virtualenv .venv
source .venv/bin/activate
pip install pywatch
pywatch ./vendor/bin/phpunit ./tests/*.php
What Next
Use Docker
if we want to test a specific version of PHP
Source: https://serversforhackers.com/c/testing-in-containers