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 Feb 2, 2015
2 parents 55ac4e9 + 6d4750a commit c94689d
Show file tree
Hide file tree
Showing 112 changed files with 8,277 additions and 2,948 deletions.
126 changes: 69 additions & 57 deletions .ci-env.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@

# Use the develop branch for WPCS for compatibility with PHPCS 2.0
export WPCS_GIT_TREE=develop

# Set up for the PHPUnit pass.
setup-phpunit() {

if [[ $( php --version | grep ' 5.2' ) ]]; then
mkdir -p vendor/jdgrimes/wp-plugin-uninstall-tester \
&& git clone https://github.com/JDGrimes/wp-plugin-uninstall-tester.git vendor/jdgrimes/wp-plugin-uninstall-tester
if [[ $TRAVIS_PHP_VERSION == '5.2' ]]; then
mkdir -p vendor/jdgrimes/wp-plugin-uninstall-tester
curl -L https://github.com/JDGrimes/wp-plugin-uninstall-tester/archive/master.tar.gz \
| tar xvz --strip-components=1 -C vendor/jdgrimes/wp-plugin-uninstall-tester
elif [[ $TRAVIS_PHP_VERSION == hhvm ]]; then
composer require satooshi/php-coveralls:dev-master
mkdir -p build/logs
else
composer install
fi

wget -O /tmp/install-wp-tests.sh \
https://raw.githubusercontent.com/wp-cli/wp-cli/master/templates/install-wp-tests.sh

sed -i 's/$WP_VERSION == '"'"'latest'"'"'/$WP_VERSION == '"'"'stable'"'"'/' \
/tmp/install-wp-tests.sh

bash /tmp/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION

sed -i 's/do_action( '"'"'admin_init'"'"' )/if ( ! isset( $GLOBALS['"'"'_did_admin_init'"'"'] ) \&\& $GLOBALS['"'"'_did_admin_init'"'"'] = true ) do_action( '"'"'admin_init'"'"' )/' \
/tmp/wordpress-tests/includes/testcase-ajax.php

cd /tmp/wordpress/wp-content/plugins
ln -s $PLUGIN_DIR $PLUGIN_SLUG
cd $PLUGIN_DIR
Expand All @@ -33,16 +47,13 @@ setup-codesniff() {

npm install -g jshint

if [ -e composer.json ]; then
wget http://getcomposer.org/composer.phar \
&& php composer.phar install --dev
fi
composer install
}

# Check php files for syntax errors.
codesniff-php-syntax() {
if [[ $TRAVISCI_RUN == codesniff ]] || [[ $TRAVISCI_RUN == phpunit ]]; then
find . ! -path "./bin/*" ! -path "./vendor/*" \( -name '*.php' -o -name '*.inc' \) \
if [[ $TRAVISCI_RUN == codesniff ]] || [[ $TRAVISCI_RUN == phpunit && $WP_VERSION == stable && $TRAVIS_PHP_VERSION != '5.3' ]]; then
find . ! -path "./dev-lib/*" ! -path "./vendor/*" \( -name '*.php' -o -name '*.inc' \) \
-exec php -lf {} \;
else
echo 'Not running PHP syntax check.'
Expand All @@ -52,7 +63,7 @@ codesniff-php-syntax() {
# Check php files with PHPCodeSniffer.
codesniff-phpcs() {
if [[ $TRAVISCI_RUN == codesniff ]]; then
$PHPCS_DIR/scripts/phpcs -n --standard=$WPCS_STANDARD \
$PHPCS_DIR/scripts/phpcs -ns --standard=$WPCS_STANDARD \
$(if [ -n "$PHPCS_IGNORE" ]; then echo --ignore=$PHPCS_IGNORE; fi) \
$(find . -name '*.php')
else
Expand Down Expand Up @@ -81,83 +92,84 @@ codesniff-l10n() {
# Check XML files for syntax errors.
codesniff-xmllint() {
if [[ $TRAVISCI_RUN == codesniff ]]; then
xmllint --noout $(find . ! -path "./bin/*" ! -path "./vendor/*" \( -name '*.xml' -o -name '*.xml.dist' \))
xmllint --noout $(find . ! -path "./dev-lib/*" ! -path "./vendor/*" \( -name '*.xml' -o -name '*.xml.dist' \))
else
echo 'Not running xmlint.'
fi
}

# Run basic PHPUnit tests.
phpunit-basic() {
if [[ $TRAVISCI_RUN == phpunit ]]; then
phpunit \
$(
if [ -e .coveralls.yml ]; then
echo --coverage-clover build/logs/clover.xml
fi
)
else
if [[ $TRAVISCI_RUN != phpunit ]]; then
echo 'Not running PHPUnit.'
return
fi
}

# Run uninstall PHPUnit tests.
phpunit-uninstall() {
if [[ $TRAVISCI_RUN == phpunit ]]; then
if [[ $( php --version | grep ' 5.2' ) ]]; then
sed -i '' -e 's/<group>uninstall<\/group>//' ./phpunit.xml.dist
local TEST_GROUP=${1-''}
local CLOVER_FILE=${2-basic}

local GROUP_OPTION=''
local COVERAGE_OPTION=''

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

if [[ $TEST_GROUP != '' ]]; then
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

phpunit --group=uninstall
else
echo 'Not running PHPUnit.'
if [[ $TRAVIS_PHP_VERSION == hhvm ]]; then
COVERAGE_OPTION="--coverage-clover build/logs/clover-$CLOVER_FILE.xml"
fi

phpunit $GROUP_OPTION $COVERAGE_OPTION
}

# Run uninstall PHPUnit tests.
phpunit-uninstall() {
phpunit-basic uninstall
}

# Run Ajax PHPUnit tests.
phpunit-ajax() {
if
[[ $TRAVISCI_RUN == phpunit ]] \
&& [[ $WP_MULTISITE == 0 || $WP_VERSION == latest ]];
then
if [[ $( php --version | grep ' 5.2' ) ]]; then
sed -i '' -e 's/<group>ajax<\/group>//' ./phpunit.xml.dist
fi
phpunit-basic ajax
}

phpunit --group=ajax
else
echo 'Not running Ajax tests.'
fi
# Run the basic tests on multisite.
phpunit-ms() {
WP_MULTISITE=1 phpunit-basic '' ms
}

# Run the uninstall tests on multisite.
phpunit-ms-uninstall() {
WP_MULTISITE=1 phpunit-basic uninstall ms
}

# Run the ajax tests on multisite.
phpunit-ms-ajax() {
WP_MULTISITE=1 phpunit-basic ajax ms
}

# Run basic tests for multisite in network mode.
phpunit-ms-network() {
if [[ $TRAVISCI_RUN == phpunit ]] && [[ $WP_MULTISITE == 1 ]]; then
WORDPOINTS_NETWORK_ACTIVE=1 phpunit
else
echo 'Not running network tests.'
fi
WORDPOINTS_NETWORK_ACTIVE=1 WP_MULTISITE=1 phpunit-basic '' ms-network
}

# Run uninstall tests in multisite in network mode.
phpunit-ms-network-uninstall() {
if [[ $TRAVISCI_RUN == phpunit ]] && [[ $WP_MULTISITE == 1 ]]; then
WORDPOINTS_NETWORK_ACTIVE=1 phpunit --group=uninstall
else
echo 'Not running network tests.'
fi
WORDPOINTS_NETWORK_ACTIVE=1 WP_MULTISITE=1 phpunit-basic uninstall ms-network
}

# Run Ajax tests in multisite in network mode.
phpunit-ms-network-ajax() {
if
[[ $TRAVISCI_RUN == phpunit ]] \
&& [[ $WP_MULTISITE == 1 ]] && [[ $WP_VERSION == latest ]];
then
WORDPOINTS_NETWORK_ACTIVE=1 phpunit --group=ajax
else
echo 'Not running network Ajax tests.'
fi
WORDPOINTS_NETWORK_ACTIVE=1 WP_MULTISITE=1 phpunit-basic ajax ms-network
}

# EOF
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src_dir: src
coverage_clover: build/logs/clover-*.xml
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor/
vendor/
.idea/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "dev-lib"]
path = dev-lib
url = https://github.com/xwp/wp-dev-lib.git
3 changes: 2 additions & 1 deletion .jshintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src/assets/js/jquery.datatables.min.js
src/assets/js/jquery.datatables.min.js
vendor/
2 changes: 1 addition & 1 deletion .jshintrc
24 changes: 13 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ php:

env:
- TRAVISCI_RUN=codesniff
- TRAVISCI_RUN=phpunit WP_VERSION=latest WP_MULTISITE=0
- TRAVISCI_RUN=phpunit WP_VERSION=latest WP_MULTISITE=1
- TRAVISCI_RUN=phpunit WP_VERSION=3.9 WP_MULTISITE=0
- TRAVISCI_RUN=phpunit WP_VERSION=3.9 WP_MULTISITE=1
- TRAVISCI_RUN=phpunit WP_VERSION=3.8 WP_MULTISITE=0
- TRAVISCI_RUN=phpunit WP_VERSION=3.8 WP_MULTISITE=1
- TRAVISCI_RUN=phpunit WP_VERSION=latest
- TRAVISCI_RUN=phpunit WP_VERSION=stable
- TRAVISCI_RUN=phpunit WP_VERSION=4.0
- TRAVISCI_RUN=phpunit WP_VERSION=3.9
- TRAVISCI_RUN=phpunit WP_VERSION=3.8

sudo: false

matrix:
include:
# Only run HHVM against the latest for now.
- php: hhvm
env: TRAVISCI_RUN=phpunit WP_VERSION=latest WP_MULTISITE=0
- php: hhvm
env: TRAVISCI_RUN=phpunit WP_VERSION=latest WP_MULTISITE=1
env: TRAVISCI_RUN=phpunit WP_VERSION=stable
exclude:
# The codesniff pass only needs to be run once, I chose PHP 5.3, since WPCS requires it.
- php: 5.2
Expand All @@ -47,7 +46,7 @@ before_install:
- export PHPCS_DIR=/tmp/phpcs
- export PHPCS_GITHUB_SRC=squizlabs/PHP_CodeSniffer
- export PHPCS_GIT_TREE=master
- export PHPCS_IGNORE='vendor/*,bin/*'
- export PHPCS_IGNORE='vendor/*,dev-lib/*'
- export WPCS_DIR=/tmp/wpcs
- export WPCS_GITHUB_SRC=WordPress-Coding-Standards/WordPress-Coding-Standards
- export WPCS_GIT_TREE=master
Expand All @@ -71,11 +70,14 @@ script:
- codesniff-l10n
- codesniff-xmllint
- phpunit-basic
- phpunit-ms
- phpunit-ms-network
- phpunit-uninstall
- phpunit-ms-uninstall
- phpunit-ms-network-uninstall
- phpunit-ajax
- phpunit-ms-ajax
- phpunit-ms-network-ajax

after_script:
- if [ -e .coveralls.yml ]; then php vendor/bin/coveralls; fi
- if [[ $TRAVIS_PHP_VERSION == hhvm ]]; then php vendor/bin/coveralls; fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WordPoints [![Build Status](https://travis-ci.org/WordPoints/wordpoints.png?branch=master)](https://travis-ci.org/WordPoints/wordpoints) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/WordPoints/wordpoints/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/WordPoints/wordpoints/?branch=master) [![Translation Status](https://hosted.weblate.org/widgets/wordpoints/-/shields-badge.svg)](https://hosted.weblate.org/engage/wordpoints/?utm_source=widget)
WordPoints [![Build Status](https://travis-ci.org/WordPoints/wordpoints.png?branch=master)](https://travis-ci.org/WordPoints/wordpoints) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/WordPoints/wordpoints/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/WordPoints/wordpoints/?branch=master) [![Coverage Status](https://img.shields.io/coveralls/WordPoints/wordpoints.svg)](https://coveralls.io/r/WordPoints/wordpoints?branch=master) [![Translation Status](https://hosted.weblate.org/widgets/wordpoints/-/shields-badge.svg)](https://hosted.weblate.org/engage/wordpoints/?utm_source=widget)
==========

This is were development of the WordPoints WordPress plugin takes place. To
Expand Down
Binary file added assets/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screenshot-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions bin/.coveralls.yml

This file was deleted.

20 changes: 0 additions & 20 deletions bin/.jshintrc

This file was deleted.

45 changes: 0 additions & 45 deletions bin/.travis.yml

This file was deleted.

Loading

0 comments on commit c94689d

Please sign in to comment.