Skip to content

Commit e2d2ce1

Browse files
committed
Modernize testsuite
1 parent 5e0b5f5 commit e2d2ce1

4 files changed

Lines changed: 128 additions & 24 deletions

File tree

.travis.yml

Lines changed: 112 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,123 @@
1-
sudo: required
2-
31
language: php
42

3+
stages:
4+
- pre-conditions
5+
- test
6+
- quality
7+
8+
################
9+
# Test stage #
10+
################
11+
512
php:
6-
- 5.6
7-
- 7.0
8-
- 7.1
913
- 7.2
1014
- 7.3
15+
- 7.4snapshot
1116

1217
env:
13-
- SIMPLESAMLPHP_VERSION=1.17.*
14-
15-
matrix:
16-
allow_failures:
17-
- php: 7.3
18+
- COMMAND="composer install"
19+
- COMMAND="composer update"
1820

1921
before_script:
20-
- composer require "simplesamlphp/simplesamlphp:${SIMPLESAMLPHP_VERSION}" --no-update
21-
- composer update --no-interaction
22+
- ${COMMAND}
2223

2324
script:
24-
- vendor/simplesamlphp/simplesamlphp-test-framework/bin/check-syntax-php.sh
25-
- if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then php vendor/phpunit/phpunit/phpunit; else php vendor/phpunit/phpunit/phpunit --no-coverage; fi
26-
- if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then vendor/bin/psalm; fi
27-
28-
after_success:
29-
# Codecov, need to edit bash uploader for incorrect TRAVIS_PYTHON_VERSION environment variable matching, at least until codecov/codecov-bash#133 is resolved
30-
- curl -s https://codecov.io/bash > .codecov
31-
- sed -i -e 's/TRAVIS_.*_VERSION/^TRAVIS_.*_VERSION=/' .codecov
32-
- chmod +x .codecov
33-
- if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then ./.codecov -X gcov; fi
34-
# - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then bash <(curl -s https://codecov.io/bash); fi
25+
- php vendor/bin/phpunit --no-coverage
26+
27+
jobs:
28+
fast_finish: true
29+
30+
allow_failures:
31+
- php: 7.3
32+
env: Security check (composer install)
33+
- php: 7.3
34+
env: Security check (composer update)
35+
- php: 7.3
36+
env: Psalm
37+
- php: 7.3
38+
env: PHP Codesniffer
39+
40+
include:
41+
42+
##########################
43+
# Pre-conditions stage #
44+
##########################
45+
46+
- stage: pre-conditions
47+
env: Syntax check PHP
48+
php: 7.2
49+
before_script:
50+
- composer install
51+
script:
52+
- vendor/bin/check-syntax-php.sh
53+
54+
- stage: pre-conditions
55+
env: Syntax check PHP
56+
php: 7.3
57+
before_script:
58+
- composer install
59+
script:
60+
- vendor/bin/check-syntax-php.sh
61+
62+
- stage: pre-conditions
63+
env: Syntax check PHP
64+
php: 7.4snapshot
65+
before_script:
66+
- composer install
67+
script:
68+
- vendor/bin/check-syntax-php.sh
69+
70+
- stage: pre-conditions
71+
env: Syntax check YAML / XML / JSON
72+
before_script:
73+
- composer require simplesamlphp/simplesamlphp-test-framework --dev
74+
script:
75+
- vendor/simplesamlphp/simplesamlphp-test-framework/bin/check-syntax-json.sh
76+
- vendor/simplesamlphp/simplesamlphp-test-framework/bin/check-syntax-xml.sh
77+
- vendor/simplesamlphp/simplesamlphp-test-framework/bin/check-syntax-yaml.sh
78+
79+
###################
80+
# Quality stage #
81+
###################
82+
83+
- stage: quality
84+
php: 7.3
85+
env: Security check (composer install)
86+
before_script:
87+
- composer install
88+
script:
89+
- vendor/bin/security-checker security:check
90+
91+
- stage: quality
92+
php: 7.3
93+
env: Security check (composer update)
94+
before_script:
95+
- composer update
96+
script:
97+
- vendor/bin/security-checker security:check
98+
99+
- stage: quality
100+
php: 7.3
101+
env: Codecov
102+
before_script:
103+
- composer update
104+
- php vendor/bin/phpunit
105+
script:
106+
- bash <(curl -s https://codecov.io/bash)
107+
108+
- stage: quality
109+
php: 7.3
110+
env: Psalm
111+
before_script:
112+
- composer update
113+
script:
114+
- vendor/bin/psalm
115+
- vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run
116+
117+
- stage: quality
118+
php: 7.3
119+
env: PHP Codesniffer
120+
before_script:
121+
- composer update
122+
script:
123+
- vendor/bin/phpcs src/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"require-dev": {
4040
"simplesamlphp/simplesamlphp": "^1.17",
41-
"simplesamlphp/simplesamlphp-test-framework": "^0.0.10"
41+
"simplesamlphp/simplesamlphp-test-framework": "^0.1.0"
4242
},
4343
"support": {
4444
"issues": "https://github.com/simplesamlphp/simplesamlphp-module-ldap/issues",

phpcs.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="SimpleSAMLphp SAML2 ruleset">
3+
<description>
4+
By default it is less stringent about long lines than other coding standards
5+
</description>
6+
7+
<!-- Use this to exclude paths. You can have multiple patterns -->
8+
<!--<exclude-pattern>*/tests/*</exclude-pattern>-->
9+
<!--<exclude-pattern>*/other/*</exclude-pattern>-->
10+
11+
<!-- This is the rule we inherit from. If you want to exlude some specific rules, see the docs on how to do that -->
12+
<rule ref="PSR12"/>
13+
</ruleset>
14+

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
>
77
<projectFiles>
88
<directory name="lib" />
9+
<directory name="tests" />
910
</projectFiles>
1011

1112
<issueHandlers>

0 commit comments

Comments
 (0)