Skip to content

Commit

Permalink
php compatibility tests
Browse files Browse the repository at this point in the history
  • Loading branch information
derweili committed Jan 15, 2019
1 parent e2d409c commit aeb60ae
Show file tree
Hide file tree
Showing 9 changed files with 250 additions and 343 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ config.yml
.idea/
*.swp
packaged/
wpcs/
wpcs/
vendor/
49 changes: 0 additions & 49 deletions .phpcs.xml.dist

This file was deleted.

79 changes: 24 additions & 55 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,31 @@
sudo: false
dist: trusty

language: php

notifications:
email:
on_success: never
on_failure: change

branches:
only:
- travis-ci

cache:
directories:
- $HOME/.composer/cache

matrix:
include:
- php: 7.2
env: WP_VERSION=latest
- php: 7.1
env: WP_VERSION=latest
- php: 7.0
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=trunk
- php: 5.6
env: WP_TRAVISCI=phpcs
- name: "PHP 5.4 Compatibility Test"
php: "5.4"
env: TEST_VERSION=5.4
- name: "PHP 5.5 Compatibility Test"
php: "5.5"
env: TEST_VERSION=5.5
- name: "PHP 5.6 Compatibility Test"
php: "5.6"
env: TEST_VERSION=5.6
- name: "PHP7.0 Compatibility Test"
php: "7.0"
env: TEST_VERSION=7.0
- name: "PHP 7.1 Compatibility Test"
php: "7.1"
env: TEST_VERSION=7.1
- name: "PHP 7.2 Compatibility Test"
php: "7.2"
env: TEST_VERSION=7.2
- name: "PHP 7.3 Compatibility Test"
php: "7.3"
env: TEST_VERSION=7.3

before_script:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
else
echo "xdebug.ini does not exist"
fi
- |
if [[ ! -z "$WP_VERSION" ]] ; then
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
composer global require "phpunit/phpunit=4.8.*|5.7.*"
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
composer global require wp-coding-standards/wpcs
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
fi
- composer install
script:
- |
if [[ ! -z "$WP_VERSION" ]] ; then
phpunit ./phpunit.xml.dist
WP_MULTISITE=1 phpunit ./phpunit.xml.dist
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
phpcs
fi
- composer install --dev
- vendor/bin/phpcs -p src/ --standard=PHPCompatibility --runtime-set testVersion $TEST_VERSION
155 changes: 0 additions & 155 deletions bin/install-wp-tests.sh

This file was deleted.

5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@
],
"require": {
"composer/installers": "~1.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "*",
"wimg/php-compatibility": "*",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4"
}
}
Loading

0 comments on commit aeb60ae

Please sign in to comment.