Skip to content

Commit 7826dd0

Browse files
swissspidyjdpedrie
authored andcommitted
Run tests against PHP 7.3+ and check for cross-version support… (#1684)
* Move phpcs config to root folder * Run tests against PHP 7.3 and PHP 7.4 * Check for cross-version support for PHP 5.4 and higher * Only downgrade guzzle and phpseclib on Travis Prevents downgrading dev dependencies
1 parent 5f98e13 commit 7826dd0

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
phpunit.xml
3+
phpcs.xml
34
composer.lock
45
vendor
56
examples/testfile-small.txt

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ php:
2323
- 7.0
2424
- 7.1
2525
- 7.2
26+
- 7.3
27+
- 7.4snapshot
2628

2729
# Test lowest dependencies on PHP 5.4
2830
# (Guzzle 5.2, phpseclib 0.3)
2931
matrix:
3032
include:
3133
- php: 5.4
32-
env: COMPOSER_CMD="composer update --prefer-lowest" RUN_PHP_CS=true
34+
env: COMPOSER_CMD="composer update phpseclib/phpseclib guzzlehttp/guzzle guzzlehttp/psr7 --prefer-lowest" RUN_PHP_CS=true
35+
allow_failures:
36+
- php: 7.4snapshot
3337

3438
before_install:
3539
- composer self-update
@@ -44,4 +48,4 @@ before_script:
4448

4549
script:
4650
- vendor/bin/phpunit
47-
- if [[ "$RUN_PHP_CS" == "true" ]]; then vendor/bin/phpcs src --standard=style/ruleset.xml -np; fi
51+
- if [[ "$RUN_PHP_CS" == "true" ]]; then vendor/bin/phpcs src -np; fi

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"squizlabs/php_codesniffer": "~2.3",
2121
"symfony/dom-crawler": "~2.1",
2222
"symfony/css-selector": "~2.1",
23-
"cache/filesystem-adapter": "^0.3.2"
23+
"cache/filesystem-adapter": "^0.3.2",
24+
"phpcompatibility/php-compatibility": "^9.2",
25+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0"
2426
},
2527
"suggest": {
2628
"cache/filesystem-adapter": "For caching certs and tokens (using Google_Client::setCache)"

style/ruleset.xml renamed to phpcs.xml.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<!-- PHP code MUST use only UTF-8 without BOM. -->
1111
<rule ref="Generic.Files.ByteOrderMark"/>
1212

13+
<!-- Check for cross-version support for PHP 5.4 and higher. -->
14+
<rule ref="PHPCompatibility">
15+
<config name="testVersion" value="5.4-"/>
16+
</rule>
17+
1318
<!-- Check for duplicated class names -->
1419
<rule ref="Generic.Classes.DuplicateClassName" />
1520

0 commit comments

Comments
 (0)