- Simplify the setup of a PHP environment
- Use at the same time different versions of PHP
- PHP 7.1.2
- PHPUnit 5.7 (Compatible with PHP 5.6, PHP 7.0, and PHP 7.1)
- First PHPUnit test
- Phpstorm settings
$ make build
$ make composer-install
make test
Follow the instructions according your operating system
In linux is:
Click: Build, execution, deployment | Docker
Click: +
Write: API Url: unix:///var/run/docker.sock
Write: Docker compose executable: /usr/local/bin/docker-compose
Click: Languages & Frameworks | PHP
Click: CLI Interpreter | ...
Click: + | Remote
Write: Name: Docker PHP 7.1.2
Select: Remote | Docker
Write: Image name: my-php
Write: General executanble: php
Click: Languages & Frameworks | PHP | PHPUnit
Click: + | By Remote Interpreter
Select: Cli interpreter: Docker PHP 7.1.2
Click: PHP Unit library: Use composer autoloader
Write: Path to script: vendor/autoloader.php
Right click: tests folder | Run 'tests'
If you want to use other version of PHP it's as easy as follow the steps:
- Edit Dockerfile
- Select a valid version of PHP from Docker Hub
- Follow the "Prepare setup" steps
- Validate the composer.json to verify all the requisites are satisfied.