1 minute setup to start practicing a kata
git clone https://github.com/CodiumTeam/php-kata-bootstrap
cd php-kata-bootstrap
First option: I already have installed PHP 7.4 and composer
make dependencies
make tests
make coverage
Second option: I already have installed docker
make docker-build
make docker-tests
make docker-coverage
- Simplify the setup of a PHP environment for katas
- Tests running in seconds
- Setup with or without docker
- Tutorial to run the tests inside PhpStorm
- PHP 7.4
- PHPUnit 9 (Compatible with PHP 7.3 and 7.4)
- First PHPUnit test
- Phpstorm settings
make docker-build
make dependencies
make docker-tests
make tests
Follow the instructions according your operating system
In linux is:
Open: Preferences
Click: Build, execution, deployment | Docker
Click: +
Write: API Url: unix:///var/run/docker.sock
Write: Docker compose executable: /usr/local/bin/docker-compose
In Mac is:
Open: Preferences
Click: Build, execution, deployment | Docker
Click: +
Click: Docker for Mac
Click: Languages & Frameworks | PHP
Click: CLI Interpreter | ...
Click: + | From Docker, Vagrant...
Select: Remote | Docker
Write: Image name: php-docker-bootstrap
Write: Php interpreter: php
Write: Name: Docker PHP 7.4
Click: Languages & Frameworks | PHP | Test Frameworks
Click: + | By Remote Interpreter
Select: Cli interpreter: Docker PHP 7.4
Click: PHP Unit library: Use composer autoloader
Write: Path to script: vendor/autoloader.php
Right click: tests folder | Run 'tests'
make docker-coverage
make coverage
Right click: tests folder | Run 'tests with Coverage'
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.