Development-related information
- Docker
- Your favourite IDE :)
-
Build, create and start Docker's containers by running command:
docker-compose up -d
-
Rebuild project by running command (installs packages, prepares required directories and runs tests):
docker-compose exec php phing
Available as composer service. You can run any Composer's command using the composer service:
docker-compose run --rm composer [command]Examples below.
docker-compose run --rm composer installdocker-compose run --rm composer updatedocker-compose run --rm composer require [vendor]/[package]docker-compose run --rm composer remove [vendor]/[package]Fix coding standard by running command:
docker-compose exec php php-cs-fixer fixor
docker-compose exec php phing -f phing/tests.xml build:fix-coding-standardsOmit cache and run the Fixer from scratch by running command:
docker-compose exec php rm .php_cs.cache && docker-compose exec php php-cs-fixer fixInstall required packages by running command: docker-compose run --rm composer install.
Running PHPUnit tests
docker-compose run --rm phpunit --verboseor
docker-compose exec php phing -f phing/tests.xml test:phpunitdocker-compose run --rm phpunit --verbose --no-coverageRunning phpspec tests
docker-compose exec php php vendor/bin/phpspec runor
docker-compose exec php phing -f phing/tests.xml test:phpspecServed by Infection — Mutation Testing Framework.
$ docker-compose exec php bash
root@18f2f0cfaa5d:/var/www/application# XDEBUG_MODE=coverage ./vendor/bin/infection --threads=$(nproc)or
$ docker-compose exec php bash
root@18f2f0cfaa5d:/var/www/application# XDEBUG_MODE=coverage phing -f phing/tests.xml test:infection$ docker-compose exec php bash
root@18f2f0cfaa5d:/var/www/application# XDEBUG_MODE=coverage ./vendor/bin/infection --threads=$(nproc) --filter=src/Service/PaginationService.phpExample of output:
125 mutations were generated:
105 mutants were killed
3 mutants were not covered by tests
5 covered mutants were not detected
0 errors were encountered
12 time outs were encountered
Metrics:
Mutation Score Indicator (MSI): 93%
Mutation Code Coverage: 97%
Covered Code MSI: 95%build/reports/infection/infection-log.txtbuild/reports/infection/summary-log.txt
Rebuild project and run tests by running command:
docker-compose exec php phing