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 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.2
- PHPUnit 7 (Compatible with PHP 7.1, 7.2 and 7.3)
- 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: + | Remote
Write: Name: Docker PHP 7.2
Select: Remote | Docker
Write: Image name: php-docker-bootstrap
Write: General executanble: php
Click: Languages & Frameworks | PHP | PHPUnit
Click: + | By Remote Interpreter
Select: Cli interpreter: Docker PHP 7.2
Click: PHP Unit library: Use composer autoloader
Write: Path to script: vendor/autoloader.php
Write: Default configuration file: phpunit.xml.dist
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.