Skip to content

Commit 9908f42

Browse files
authored
Add tests (#13)
* Add .editorconfig file * Fix capital in namespace * Add tests * Enable bleeding edge for PHPStan
1 parent 879be48 commit 9908f42

11 files changed

+1923
-30
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
indent_style = space
9+
indent_size = 4
10+
11+
[*.neon]
12+
indent_style = tab

.github/workflows/ci.yaml

+37-10
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,47 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010

1111
jobs:
12+
tests:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php: [ '8.1', '8.2', '8.3', '8.4' ]
18+
dependency-versions: [ lowest, highest ]
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: '${{ matrix.php }}'
27+
coverage: none
28+
29+
- name: Install Composer packages
30+
uses: ramsey/composer-install@v3
31+
with:
32+
dependency-versions: '${{ matrix.dependency-versions }}'
33+
34+
- name: Run tests
35+
run: vendor/bin/phpunit --colors=always
36+
1237
phpstan:
1338
runs-on: ubuntu-latest
1439

1540
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v4
41+
- name: Checkout code
42+
uses: actions/checkout@v4
1843

19-
- name: Set up PHP
20-
uses: shivammathur/setup-php@v2
21-
with:
22-
php-version: '8.1'
44+
- name: Set up PHP
45+
uses: shivammathur/setup-php@v2
46+
with:
47+
php-version: '8.1'
2348

24-
- name: Install Composer packages
25-
uses: ramsey/composer-install@v3
49+
- name: Install Composer packages
50+
uses: ramsey/composer-install@v3
51+
with:
52+
dependency-versions: '${{ matrix.dependency-versions }}'
2653

27-
- name: Run PHPStan
28-
run: vendor/bin/phpstan --ansi
54+
- name: Run PHPStan
55+
run: vendor/bin/phpstan --ansi

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/vendor/
2+
/.phpunit.cache

composer.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
"license": "MIT",
1111
"autoload": {
1212
"psr-4": {
13-
"TicketSwap\\PHPstanErrorFormatter\\": "src/"
13+
"TicketSwap\\PHPStanErrorFormatter\\": "src/"
14+
}
15+
},
16+
"autoload-dev": {
17+
"psr-4": {
18+
"TicketSwap\\PHPStanErrorFormatter\\": "tests/"
1419
}
1520
},
1621
"extra": {
@@ -22,5 +27,8 @@
2227
},
2328
"config": {
2429
"sort-packages": true
30+
},
31+
"require-dev": {
32+
"phpunit/phpunit": "^10.5.35"
2533
}
2634
}

0 commit comments

Comments
 (0)