Skip to content

Commit

Permalink
Adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankraemer committed Jul 18, 2024
1 parent ce59faf commit dfbd7f7
Show file tree
Hide file tree
Showing 14 changed files with 2,958 additions and 1,229 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/tmp/
/tools/
.idea/
infection.log
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.DEFAULT_GOAL := help

help:
@echo "Available commands:"
@echo " - run-tests: Run tests"
@echo " - run-infection: Runs Infection mutation testing"
@echo " - coverage-text: Runs coverage text"
@echo " - coverage-html: Runs coverage html"
@echo " - all: Runs CS-Fixer, CS-Checker, Static Analyser and Tests"
@echo " - shell: Run shell"

run-tests:
@echo "Running tests"
docker compose run php composer test

run-infection:
@echo "Running infection mutation testing"
docker compose run php composer infection

coverage-text:
@echo "Running coverage text"
docker compose run php composer test-coverage

coverage-html:
@echo "Running coverage text"
docker compose run php composer test-coverage-html

all:
@echo "Running CS-Fixer, CS-Checker, Static Analyser and Tests"
docker compose run php composer all

shell:
@echo "Running shell"
docker compose run --service-ports --entrypoint /bin/bash php
40 changes: 37 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
"phpunit/phpunit": "^10.5",
"predis/predis": "^2.2",
"ramsey/uuid": "^4.7",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan": "^1.11",
"phpmd/phpmd": "^2.15",
"squizlabs/php_codesniffer": "^3.9"
"squizlabs/php_codesniffer": "^3.9",
"infection/infection": "^0.29.6"
},
"autoload": {
"psr-4": {
Expand All @@ -27,8 +28,41 @@
}
},
"config": {
"bin-dir": "bin"
"bin-dir": "bin",
"allow-plugins": {
"infection/extension-installer": true
}
},
"scripts": {
"test": [
"phpunit"
],
"infection": [
"infection"
],
"test-coverage": [
"phpunit --coverage-text"
],
"test-coverage-html": [
"phpunit --coverage-html tmp/coverage/"
],
"cscheck": [
"phpcs src/ tests/ --standard=PSR12 -s"
],
"csfix": [
"phpcbf src/ tests/ --standard=PSR12"
],
"analyze": [
"phpstan analyse src/"
],
"phpmd": [
"bin/phpmd ./src text cleancode,codesize,controversial,design"
],
"all": [
"@csfix",
"@cscheck",
"@analyze",
"@test"
]
}
}
Loading

0 comments on commit dfbd7f7

Please sign in to comment.