Skip to content

Commit

Permalink
Refactoring tests and the EventStoreInterface (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankraemer authored Jul 13, 2024
1 parent c44ff53 commit ac563a0
Show file tree
Hide file tree
Showing 23 changed files with 3,475 additions and 1,033 deletions.
4 changes: 4 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DB_HOST=mysql-container
DB_DATABASE=test
DB_USER=root;
DB_PASSWORD=changeme
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.2', '8.3']

steps:
- uses: actions/checkout@v4
Expand All @@ -68,13 +68,13 @@ jobs:
- name: Run PHPUnit
run: |
if [[ ${{ matrix.php-version }} == '8.1' ]]; then
if [[ ${{ matrix.php-version }} == '8.2' ]]; then
bin/phpunit --coverage-clover=coverage.xml
else
bin/phpunit
fi
- name: Code Coverage Report
if: success() && matrix.php-version == '8.1'
if: success() && matrix.php-version == '8.2'
uses: codecov/codecov-action@v4

cs-stan:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.idea
/vendor/
/bin/
/tmp/
/.phpunit.cache/
infection.log
.env
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
44 changes: 42 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,53 @@
"Phauthentic\\EventStore\\Tests\\": "tests/"
}
},
"require": {
"php": "^8.2"
},
"require-dev": {
"ext-pdo": "*",
"phpunit/phpunit": "^10.5",
"squizlabs/php_codesniffer": "^3.9",
"phpstan/phpstan": "^1.10",
"ramsey/uuid": "^4.7"
"ramsey/uuid": "^4.7",
"infection/infection": "^0.29.6"
},
"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 ac563a0

Please sign in to comment.