Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
JDGrimes committed Dec 8, 2016
2 parents 6dbe163 + d624b52 commit be894cc
Show file tree
Hide file tree
Showing 396 changed files with 19,268 additions and 5,029 deletions.
2 changes: 1 addition & 1 deletion .gitignore
5 changes: 1 addition & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "dev-lib"]
path = dev-lib
url = https://github.com/xwp/wp-dev-lib.git
[submodule "dev-lib-wordpoints"]
path = dev-lib-wordpoints
path = dev-lib
url = https://github.com/WordPoints/dev-lib.git
2 changes: 1 addition & 1 deletion .jshintignore
2 changes: 1 addition & 1 deletion .jshintrc
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ php:
- 5.5
- 5.6
- 7.0
- 7.1

env:
- TRAVISCI_RUN=codesniff
- TRAVISCI_RUN=phpunit WP_VERSION=master
- TRAVISCI_RUN=phpunit WP_VERSION=4.5
- TRAVISCI_RUN=phpunit WP_VERSION=4.4
- TRAVISCI_RUN=phpunit WP_VERSION=4.6

sudo: false

Expand All @@ -39,6 +39,10 @@ matrix:
env: TRAVISCI_RUN=codesniff
- php: 7.0
env: TRAVISCI_RUN=codesniff
- php: 7.1
env: TRAVISCI_RUN=codesniff
- php: 7.1
env: TRAVISCI_RUN=phpunit WP_VERSION=4.6
allow_failures:
- php: hhvm
- php: nightly
Expand All @@ -54,6 +58,7 @@ script:
- codesniff-php-syntax
- codesniff-php-autoloaders
- codesniff-phpcs
- codesniff-strings
- codesniff-jshint
- codesniff-l10n
- codesniff-xmllint
Expand All @@ -69,8 +74,7 @@ script:
- phpunit-ms-ajax
- phpunit-ms-network-ajax
- wpcept-run
- WORDPOINTS_NETWORK_ACTIVE=1 WP_MULTISITE=1 wpcept-basic acceptance network

after_script:
- ls -l build/logs/
- composer require --prefer-source satooshi/php-coveralls:'~1.0'
- source $DEV_LIB_PATH/travis/after_script.sh
95 changes: 14 additions & 81 deletions .wordpoints-dev-lib-config.sh
Original file line number Diff line number Diff line change
@@ -1,92 +1,25 @@
#!/usr/bin/env bash

# This project is a plugn.
# This project is a plugin.
export WORDPOINTS_PROJECT_TYPE=wordpoints

# The dev lib uses a non-default path.
export DEV_LIB_PATH=dev-lib-wordpoints

# Sets up custom configuration.
function wordpoints-dev-lib-config() {

# Use the develop branch for WPCS.
#export WPCS_GIT_TREE=develop

# Use a stable commit for PHPCS.
export PHPCS_GIT_TREE=fb72ed32f8418db5e7770be1653e62e0d6f5dd3d

# Ignore the WordPress dev lib when codesniffing.
CODESNIFF_PATH+=('!' -path "./dev-lib/*")
export CODESNIFF_PATH

# Fix failures on HHVM (#317) and when running Codeception tests (#321).
if [[ $DO_CODE_COVERAGE == 1 || $DO_WP_CEPT == 1 ]]; then
alias phpunit-ms-network='phpunit-ms-network; A=$?; composer remove --dev jdgrimes/wp-filesystem-mock; [[ $A == 0 ]]'
fi

alias phpunit-uninstall='wordpoints-phpunit-basic uninstall'
alias phpunit-ms-uninstall='WP_MULTISITE=1 wordpoints-phpunit-basic uninstall ms'
alias phpunit-ms-network-uninstall='WORDPOINTS_NETWORK_ACTIVE=1 WP_MULTISITE=1 wordpoints-phpunit-basic uninstall ms-network'
}

# Special handling for PHPUnit uninstall tests.
wordpoints-wpdl-test-phpunit() {

local TEST_GROUP=${1-''}
local CLOVER_FILE=${2-basic}

local GROUP_OPTION=()
local COVERAGE_OPTION=()

if [[ $TEST_GROUP != '' ]]; then
if [[ $TEST_GROUP == ajax && $RUN_AJAX_TESTS == 0 ]]; then
echo 'Not running Ajax tests.'
return
elif [[ $TEST_GROUP == uninstall && $RUN_UNINSTALL_TESTS == 0 ]]; then
echo 'Not running uninstall tests.'
return
fi

if [[ $WP_VERSION == '3.8' && $TEST_GROUP == ajax && $WP_MULTISITE == 1 ]]; then
echo 'Not running multisite Ajax tests on 3.8, see https://github.com/WordPoints/wordpoints/issues/239.'
return
fi

GROUP_OPTION=(--group="$TEST_GROUP")
CLOVER_FILE+="-$TEST_GROUP"

if [[ $TRAVIS_PHP_VERSION == '5.2' ]]; then
sed -i '' -e "s/<group>$TEST_GROUP<\/group>//" ./phpunit.xml.dist
fi
fi

if [[ $DO_CODE_COVERAGE == 1 ]]; then
COVERAGE_OPTION=(--coverage-clover "build/logs/clover-$CLOVER_FILE.xml")
fi

if [[ $TEST_GROUP == uninstall ]]; then
# Back-compat because PHP 5.2 runs PHPUnit 3.6, which doesn't support the
# --testsuite option.
if [[ $TRAVIS_PHP_VERSION == 5.2 ]]; then
phpunit "${GROUP_OPTION[@]}" "${COVERAGE_OPTION[@]}" --no-configuration \
--no-globals-backup --bootstrap tests/phpunit/includes/bootstrap.php \
tests/phpunit/tests/uninstall.php
else
phpunit "${GROUP_OPTION[@]}" "${COVERAGE_OPTION[@]}" --testsuite uninstall
fi
else
phpunit "${GROUP_OPTION[@]}" "${COVERAGE_OPTION[@]}"
fi
}

# Special handling for PHPUnit uninstall tests.
wordpoints-phpunit-basic() {
if [[ $TRAVISCI_RUN != phpunit ]]; then
echo 'Not running PHPUnit.'
return
fi

wordpoints-wpdl-test-phpunit "${@:1}"
export WPCS_GIT_TREE=develop

# Use PHPCS 2.7.0, since WPCS 0.11.0 requires it.
export PHPCS_GIT_TREE=master

# Ignore some strings that are expected.
CODESNIFF_IGNORED_STRINGS=(\
"${CODESNIFF_IGNORED_STRINGS[@]}" \
# Doesn't support HTTPS.
-e sodipodi.sourceforge.net \
# Ticket related to removing blank target links, mentioned in the changelog.
-e '#558' \
)
}

# EOF
Loading

0 comments on commit be894cc

Please sign in to comment.