-
Notifications
You must be signed in to change notification settings - Fork 65
/
Makefile
30 lines (21 loc) · 1.11 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.PHONY:help cs csfix test testcoverage testcoveragehtml clean
.DEFAULT_GOAL=help
help:
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
composer.phar:
@curl -sS https://getcomposer.org/installer | php -- --filename=composer.phar
@chmod +x composer.phar
vendor: composer.phar composer.json
@./composer.phar install --prefer-source --no-interaction --optimize-autoloader
cs: vendor ## Check for coding standards
@php vendor/bin/phpcs
csfix: vendor ## Check and fix for coding standards
@php vendor/bin/phpcbf
test: vendor phpunit.xml ## Unit testing
@php vendor/bin/phpunit --stop-on-failure
testcoverage: composer.phar vendor phpunit.xml ## Unit testing with code coverage
@XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
testcoveragehtml: composer.phar vendor phpunit.xml ## Unit testing with code coverage in HTML
@XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-html coverage
clean: ## Remove files needed for tests
@rm -rf composer.phar composer.lock vendor testbench coverage .phpunit.result.cache .phpunit.cache