Skip to content

Commit 786817e

Browse files
author
Florian Krämer
committed
Fixing tests, improving types
1 parent 3be2dd0 commit 786817e

39 files changed

+2527
-1540
lines changed

.editorconfig

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
; This file is for unifying the coding style for different editors and IDEs.
2-
; More information at http://editorconfig.org
3-
root = true
4-
5-
[*]
6-
indent_style = space
7-
indent_size = 4
8-
end_of_line = lf
9-
insert_final_newline = true
10-
trim_trailing_whitespace = true
11-
charset = utf-8
12-
13-
[*.bat]
14-
end_of_line = crlf
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
charset = utf-8
12+
13+
[*.bat]
14+
end_of_line = crlf

.github/workflows/ci.yml

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
1-
name: CI
2-
3-
on: [push, pull_request]
4-
5-
jobs:
6-
testsuite:
7-
name: Unittests
8-
runs-on: ubuntu-20.04
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
php-version: ['7.4', '8.2']
13-
14-
steps:
15-
- uses: actions/checkout@v2
16-
17-
- name: Setup PHP
18-
uses: shivammathur/setup-php@v2
19-
with:
20-
php-version: '7.4'
21-
extensions: mbstring, json, fileinfo
22-
tools: pecl
23-
coverage: pcov
24-
25-
- name: Composer install
26-
run: |
27-
if [[ ${{ matrix.prefer-lowest == 'prefer-lowest' }} ]]; then
28-
composer update --prefer-lowest --prefer-stable
29-
else
30-
composer install
31-
fi
32-
33-
- name: Phive install
34-
run: php config/composer_phive.php
35-
36-
- name: Run PHPUnit
37-
run: |
38-
if [[ ${{ matrix.php-version }} == '7.4' ]]; then
39-
bin/phpunit --coverage-clover=coverage.xml
40-
else
41-
bin/phpunit
42-
fi
43-
44-
- name: Code Coverage Report
45-
if: success() && matrix.php-version == '7.4'
46-
uses: codecov/codecov-action@v1
47-
48-
cs-stan:
49-
name: Coding Standard & Static Analysis
50-
runs-on: ubuntu-20.04
51-
52-
steps:
53-
- uses: actions/checkout@v2
54-
55-
- name: Setup PHP
56-
uses: shivammathur/setup-php@v2
57-
with:
58-
php-version: '7.4'
59-
extensions: mbstring, json, fileinfo
60-
coverage: none
61-
tools: pecl
62-
63-
- name: Composer install
64-
run: composer update --prefer-lowest --prefer-stable
65-
66-
- name: Phive install
67-
run: php config/composer_phive.php
68-
69-
- name: Run phpstan
70-
run: bin/phpstan -V && bin/phpstan analyse src -l 5 --error-format=github
71-
72-
- name: Run phpcs
73-
run: bin/phpcs --version && bin/phpcs --report=checkstyle --standard=phpcs.xml src/ tests/
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
testsuite:
7+
name: Unittests
8+
runs-on: ubuntu-20.04
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php-version: ['7.4', '8.2']
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '7.4'
21+
extensions: mbstring, json, fileinfo
22+
tools: pecl
23+
coverage: pcov
24+
25+
- name: Composer install
26+
run: |
27+
if [[ ${{ matrix.prefer-lowest == 'prefer-lowest' }} ]]; then
28+
composer update --prefer-lowest --prefer-stable
29+
else
30+
composer install
31+
fi
32+
33+
- name: Phive install
34+
run: php config/composer_phive.php
35+
36+
- name: Run PHPUnit
37+
run: |
38+
if [[ ${{ matrix.php-version }} == '7.4' ]]; then
39+
bin/phpunit --coverage-clover=coverage.xml
40+
else
41+
bin/phpunit
42+
fi
43+
44+
- name: Code Coverage Report
45+
if: success() && matrix.php-version == '7.4'
46+
uses: codecov/codecov-action@v1
47+
48+
cs-stan:
49+
name: Coding Standard & Static Analysis
50+
runs-on: ubuntu-20.04
51+
52+
steps:
53+
- uses: actions/checkout@v2
54+
55+
- name: Setup PHP
56+
uses: shivammathur/setup-php@v2
57+
with:
58+
php-version: '7.4'
59+
extensions: mbstring, json, fileinfo
60+
coverage: none
61+
tools: pecl
62+
63+
- name: Composer install
64+
run: composer update --prefer-lowest --prefer-stable
65+
66+
- name: Phive install
67+
run: php config/composer_phive.php
68+
69+
- name: Run phpstan
70+
run: bin/phpstan -V && bin/phpstan analyse src -l 5 --error-format=github
71+
72+
- name: Run phpcs
73+
run: bin/phpcs --version && bin/phpcs --report=checkstyle --standard=phpcs.xml src/ tests/

.gitignore

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/.idea
2-
/.phpunit.result.cache
3-
/tmp
4-
/logs
5-
/vendor/
6-
/bin
7-
coverage.xml
8-
phive*.phar
9-
/composer.lock
1+
/.idea
2+
/.phpunit.result.cache
3+
/tmp
4+
/logs
5+
/vendor/
6+
/bin
7+
coverage.xml
8+
phive*.phar
9+
/composer.lock

.scrutinizer.yml

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
filter:
2-
excluded_paths:
3-
- bin/*
4-
- vendor/*
5-
- tests/*
6-
- config/*
7-
- docs/*
8-
- public/*
9-
- tests/bootstrap.php
10-
dependency_paths:
11-
- vendor/*
12-
13-
build_failure_conditions:
14-
- 'patches.label("Spacing").new.count > 1' # More than 1 new spacing patch
15-
16-
- 'issues.label("coding-style").exists' # No coding style issues allowed
17-
- 'issues.label("coding-style").new.exists' # No new coding style issues allowed
18-
19-
- 'issues.label("coding-style").new.count > 1' # More than 1 new coding style issues.
20-
- 'issues.severity(>= MAJOR).new.exists' # New issues of major or higher severity
21-
22-
- 'project.metric("scrutinizer.quality", < 9)' # Code Quality Rating drops below 9
23-
24-
# Code Coverage decreased from previous inspection by more than 1%
25-
- 'project.metric_change("scrutinizer.test_coverage", < -0.1)'
26-
27-
build:
28-
services:
29-
#mariadb: 10.1.40
30-
environment:
31-
hosts:
32-
localhost: '127.0.0.1'
33-
redis: true
34-
node: 10.16.0
35-
php:
36-
version: '7.4'
37-
ini:
38-
phar.readonly: 'Off'
39-
40-
nodes:
41-
tests-php74:
42-
environment:
43-
php:
44-
version: '7.4'
45-
ini:
46-
phar.readonly: 'Off'
47-
tests:
48-
override:
49-
- sh ./config/scrutinizer-setup.sh
50-
-
51-
command: './bin/phpunit --coverage-clover=coverage.xml --bootstrap ./tests/bootstrap.php'
52-
coverage:
53-
file: 'coverage.xml'
54-
format: 'php-clover'
55-
56-
analysis:
57-
tests:
58-
override:
59-
- php-scrutinizer-run --enable-security-analysis
60-
- phpcs-run --standard=./phpcs.xml ./src
1+
filter:
2+
excluded_paths:
3+
- bin/*
4+
- vendor/*
5+
- tests/*
6+
- config/*
7+
- docs/*
8+
- public/*
9+
- tests/bootstrap.php
10+
dependency_paths:
11+
- vendor/*
12+
13+
build_failure_conditions:
14+
- 'patches.label("Spacing").new.count > 1' # More than 1 new spacing patch
15+
16+
- 'issues.label("coding-style").exists' # No coding style issues allowed
17+
- 'issues.label("coding-style").new.exists' # No new coding style issues allowed
18+
19+
- 'issues.label("coding-style").new.count > 1' # More than 1 new coding style issues.
20+
- 'issues.severity(>= MAJOR).new.exists' # New issues of major or higher severity
21+
22+
- 'project.metric("scrutinizer.quality", < 9)' # Code Quality Rating drops below 9
23+
24+
# Code Coverage decreased from previous inspection by more than 1%
25+
- 'project.metric_change("scrutinizer.test_coverage", < -0.1)'
26+
27+
build:
28+
services:
29+
#mariadb: 10.1.40
30+
environment:
31+
hosts:
32+
localhost: '127.0.0.1'
33+
redis: true
34+
node: 10.16.0
35+
php:
36+
version: '7.4'
37+
ini:
38+
phar.readonly: 'Off'
39+
40+
nodes:
41+
tests-php74:
42+
environment:
43+
php:
44+
version: '7.4'
45+
ini:
46+
phar.readonly: 'Off'
47+
tests:
48+
override:
49+
- sh ./config/scrutinizer-setup.sh
50+
-
51+
command: './bin/phpunit --coverage-clover=coverage.xml --bootstrap ./tests/bootstrap.php'
52+
coverage:
53+
file: 'coverage.xml'
54+
format: 'php-clover'
55+
56+
analysis:
57+
tests:
58+
override:
59+
- php-scrutinizer-run --enable-security-analysis
60+
- phpcs-run --standard=./phpcs.xml ./src

composer.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,28 @@
4242
"php config/composer_post_install.php"
4343
],
4444
"test": [
45-
"\\InstituteWeb\\ComposerScripts\\ImprovedScriptExecution::apply",
4645
"./bin/phpunit"
4746
],
4847
"test-coverage": [
49-
"\\InstituteWeb\\ComposerScripts\\ImprovedScriptExecution::apply",
5048
"./bin/phpunit --coverage-text"
5149
],
5250
"test-coverage-html": [
53-
"\\InstituteWeb\\ComposerScripts\\ImprovedScriptExecution::apply",
5451
"./bin/phpunit --coverage-html ./tmp/coverage"
5552
],
5653
"cscheck": [
57-
"\\InstituteWeb\\ComposerScripts\\ImprovedScriptExecution::apply",
5854
"./bin/phpcs ./src ./tests --standard=./phpcs.xml -s"
5955
],
6056
"csfix": [
61-
"\\InstituteWeb\\ComposerScripts\\ImprovedScriptExecution::apply",
6257
"./bin/phpcbf ./src ./tests --standard=./phpcs.xml"
6358
],
6459
"analyze": [
65-
"\\InstituteWeb\\ComposerScripts\\ImprovedScriptExecution::apply",
66-
"./bin/phpstan analyse ./src -l 5"
60+
"./bin/phpstan analyse ./src"
6761
],
6862
"phive": [
69-
"\\InstituteWeb\\ComposerScripts\\ImprovedScriptExecution::apply",
7063
"php ./config/composer_phive.php"
7164
],
7265
"serve": [
73-
"\\InstituteWeb\\ComposerScripts\\ImprovedScriptExecution::apply",
66+
7467
"php -S localhost:8081 -t ./public"
7568
]
7669
}

0 commit comments

Comments
 (0)