Skip to content

Commit

Permalink
Add tests (#13)
Browse files Browse the repository at this point in the history
* Add .editorconfig file

* Fix capital in namespace

* Add tests

* Enable bleeding edge for PHPStan
  • Loading branch information
ruudk authored Oct 2, 2024
1 parent 879be48 commit 9908f42
Show file tree
Hide file tree
Showing 11 changed files with 1,923 additions and 30 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.neon]
indent_style = tab
47 changes: 37 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,47 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3', '8.4' ]
dependency-versions: [ lowest, highest ]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php }}'
coverage: none

- name: Install Composer packages
uses: ramsey/composer-install@v3
with:
dependency-versions: '${{ matrix.dependency-versions }}'

- name: Run tests
run: vendor/bin/phpunit --colors=always

phpstan:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'

- name: Install Composer packages
uses: ramsey/composer-install@v3
- name: Install Composer packages
uses: ramsey/composer-install@v3
with:
dependency-versions: '${{ matrix.dependency-versions }}'

- name: Run PHPStan
run: vendor/bin/phpstan --ansi
- name: Run PHPStan
run: vendor/bin/phpstan --ansi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/vendor/
/.phpunit.cache
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
"license": "MIT",
"autoload": {
"psr-4": {
"TicketSwap\\PHPstanErrorFormatter\\": "src/"
"TicketSwap\\PHPStanErrorFormatter\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"TicketSwap\\PHPStanErrorFormatter\\": "tests/"
}
},
"extra": {
Expand All @@ -22,5 +27,8 @@
},
"config": {
"sort-packages": true
},
"require-dev": {
"phpunit/phpunit": "^10.5.35"
}
}
Loading

0 comments on commit 9908f42

Please sign in to comment.