-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (37 loc) · 1.35 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " start-server to start the test server"
@echo " stop-server to stop the test server"
@echo " test to perform tests."
@echo " test-unit to perform unit tests."
@echo " test-integration to perform integration tests."
@echo " coverage to perform tests with code coverage."
@echo " static to run phpstan and psalm on the codebase"
install:
composer install
start-server: stop-server
php tests/bin/server.php &> /dev/null &
stop-server:
@PID=$(shell ps axo pid,command \
| grep 'tests/bin/server.php' \
| grep -v grep \
| cut -f 1 -d " "\
) && [ -n "$$PID" ] && kill $$PID || true
test: start-server
php vendor/bin/phpunit --testsuite=unit,integration
$(MAKE) stop-server
test-unit:
php vendor/bin/phpunit --testsuite=unit
test-e2e: start-server
php vendor/bin/phpunit --testsuite=e2e
$(MAKE) stop-server
coverage:
php -d xdebug.mode=coverage vendor/bin/phpunit --coverage-text --testsuite=unit
phpstan:
php vendor/bin/phpstan analyse
psalm:
php vendor/bin/psalm
static:
php vendor/bin/phpstan analyse
php vendor/bin/psalm
.PHONY: install start-server stop-server test test-unit test-e2e coverage phpstan psalm static