Skip to content

Commit

Permalink
Run tests against PHP 7.3+ and check for cross-version support… (#1684)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
swissspidy authored and jdpedrie committed Jul 31, 2019
1 parent 5f98e13 commit 7826dd0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
.DS_Store
phpunit.xml
phpcs.xml
composer.lock
vendor
examples/testfile-small.txt
Expand Down
8 changes: 6 additions & 2 deletions .travis.yml
Expand Up @@ -23,13 +23,17 @@ php:
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4snapshot

# Test lowest dependencies on PHP 5.4
# (Guzzle 5.2, phpseclib 0.3)
matrix:
include:
- php: 5.4
env: COMPOSER_CMD="composer update --prefer-lowest" RUN_PHP_CS=true
env: COMPOSER_CMD="composer update phpseclib/phpseclib guzzlehttp/guzzle guzzlehttp/psr7 --prefer-lowest" RUN_PHP_CS=true
allow_failures:
- php: 7.4snapshot

before_install:
- composer self-update
Expand All @@ -44,4 +48,4 @@ before_script:

script:
- vendor/bin/phpunit
- if [[ "$RUN_PHP_CS" == "true" ]]; then vendor/bin/phpcs src --standard=style/ruleset.xml -np; fi
- if [[ "$RUN_PHP_CS" == "true" ]]; then vendor/bin/phpcs src -np; fi
4 changes: 3 additions & 1 deletion composer.json
Expand Up @@ -20,7 +20,9 @@
"squizlabs/php_codesniffer": "~2.3",
"symfony/dom-crawler": "~2.1",
"symfony/css-selector": "~2.1",
"cache/filesystem-adapter": "^0.3.2"
"cache/filesystem-adapter": "^0.3.2",
"phpcompatibility/php-compatibility": "^9.2",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0"
},
"suggest": {
"cache/filesystem-adapter": "For caching certs and tokens (using Google_Client::setCache)"
Expand Down
5 changes: 5 additions & 0 deletions style/ruleset.xml → phpcs.xml.dist
Expand Up @@ -10,6 +10,11 @@
<!-- PHP code MUST use only UTF-8 without BOM. -->
<rule ref="Generic.Files.ByteOrderMark"/>

<!-- Check for cross-version support for PHP 5.4 and higher. -->
<rule ref="PHPCompatibility">
<config name="testVersion" value="5.4-"/>
</rule>

<!-- Check for duplicated class names -->
<rule ref="Generic.Classes.DuplicateClassName" />

Expand Down

0 comments on commit 7826dd0

Please sign in to comment.