Skip to content

Commit

Permalink
Merge branch 'release/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Mar 27, 2019
2 parents 28b508d + 1b0bedf commit 0746ad2
Show file tree
Hide file tree
Showing 25 changed files with 634 additions and 594 deletions.
25 changes: 25 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
build:
environment:
variables:
WP_TESTS_DB_NAME: 'wp_phpunit_tests'
WP_TESTS_DB_USER: 'root'
WP_TESTS_DB_PASS: ''
WP_TESTS_DB_HOST: 'localhost'
project_setup:
before:
- mysql -e "CREATE DATABASE wp_phpunit_tests"
dependencies:
override:
- composer install --ignore-platform-reqs --no-interaction
nodes:
coverage:
tests:
override:
- command: ./vendor/bin/phpunit
coverage:
file: build/logs/clover.xml
format: clover

checks:
php:
coding_standard:
name: WordPress
code_rating: true
duplication: true

build_failure_conditions:
- 'issues.label("bug").exists'

coding_style:
php:
indentation:
Expand Down
96 changes: 65 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,46 @@ sudo: false

language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- nightly
- hhvm

env:
global:
- WP_TESTS_DB_NAME=wordpress_test
- WP_TESTS_DB_USER=root
- WP_TESTS_DB_PASS=
- WP_TESTS_DB_HOST=localhost
- COMPOSER_NO_INTERACTION=1
- WP_VERSION=*

matrix:
jobs:
include:
- php: 7.3
env: WP_VERSION=^5.0 COVERAGE=1 PHPCS=1
- php: 7.2
env: WP_VERSION=^4.9
- php: 7.2
env: WP_VERSION=^4.8
- php: 7.2
env: WP_VERSION=^4.7
- php: 7.3
env: WP_MULTISITE=1
- php: 7.3
env: PHPSTAN=1
- php: 7.3
env: PHPMD=1
- php: 7.3
env: PSALM=1
- php: 7.2
- php: 7.1
- php: 7.0
- php: 5.6
- php: 5.5
- php: 5.4
- php: 5.3
dist: precise
env: TRAVIS_DIST_PRECISE=1
- php: 5.6
env: WP_MULTISITE=1
- php: 5.6
env: WP_VERSION=4.8
- php: 5.6
env: WP_VERSION=4.7 COVERAGE=1 GRUNT=1
fast_finish: true
- php: nightly
- php: hhvm
allow_failures:
- php: hhvm
- php: nightly
- env: PHPMD=1
- env: PHPSTAN=1
- env: PSALM=1

cache:
directories:
Expand All @@ -46,6 +54,23 @@ cache:
before_install:
# Install latest version of Node.js (https://github.com/creationix/nvm).
- if [ "${TRAVIS_DIST_PRECISE}" == "1" ]; then nvm install node; fi
# Create database for PHPUnit tests.
- mysql -e 'CREATE DATABASE wp_phpunit_tests;'
# Remove Xdebug for a huge performance increase:
- |
if [[ "$COVERAGE" != "1" && -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]]; then
phpenv config-rm xdebug.ini
fi
# Raise PHP memory limit to 2048MB
- echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Validate composer.json file.
- composer validate --strict
# Add Composer global vendor/bin to path.
- export PATH="$HOME/.composer/vendor/bin:$PATH"
# PHPStan
- if [ "$PHPSTAN" == "1" ]; then composer global require phpstan/phpstan; fi
# Psalm
- if [ "$PSALM" == "1" ]; then composer global require vimeo/psalm; fi

install:
# Install Grunt command line interface (https://github.com/gruntjs/grunt-cli).
Expand All @@ -56,16 +81,25 @@ install:
- composer self-update
# Install Composer packages.
- composer install

before_script:
- wget https://raw.githubusercontent.com/wp-cli/sample-plugin/master/bin/install-wp-tests.sh
- bash install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
# Test on specific WordPress version.
- composer require --dev --update-with-dependencies roots/wordpress:${WP_VERSION} wp-phpunit/wp-phpunit:${WP_VERSION}
# List available packages.
- composer show

script:
- if [[ -z "$GRUNT" ]]; then grunt phpunit; fi
- if [[ -z "$GRUNT" ]]; then grunt phplint; fi
- if [[ "$GRUNT" == "1" ]]; then grunt; fi
# PHPLint
- composer run-script phplint
# PHPUnit
- composer run-script phpunit
# PHP_CodeSniffer
- if [ "$PHPCS" == "1" ]; then composer run-script phpcs; fi
# PHP Mess Detector
- if [ "$PHPMD" == "1" ]; then composer run-script phpmd; fi
# PHPStan
- if [ "$PHPSTAN" == "1" ]; then phpstan analyze; fi
# Psalm
- if [ "$PSALM" == "1" ]; then psalm; fi

after_success:
- if [ $COVERAGE == "1" ]; then php vendor/bin/coveralls -v; fi
- if [ $COVERAGE == "1" ]; then bash <(curl -s https://codecov.io/bash); fi
- if [ "$COVERAGE" == "1" ]; then composer run-script coveralls; fi
- if [ "$COVERAGE" == "1" ]; then bash <(curl -s https://codecov.io/bash); fi
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## [Unreleased][unreleased]
-

## [1.2.1] - 2019-03-27
- Added `get_minor_units` method based on decimals of currency.
- Updated copyright to 2005-2019 Pronamic.

## [1.2.0] - 2018-12-10
- Added a `get_cents` method.
- Introduced a TaxedMoney class.
Expand Down
27 changes: 17 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "pronamic/wp-money",
"description": "WordPress Money library.",
"license": "GPL-3.0-or-later" ,
"autoload": {
"psr-4": {
Expand All @@ -21,22 +22,28 @@
"php": ">=5.3"
},
"require-dev": {
"koodimonni-language/de_DE": "*",
"koodimonni-language/fr_FR": "*",
"koodimonni-language/nl_NL": "*",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5",
"koodimonni-language/de_de": "*",
"koodimonni-language/fr_fr": "*",
"koodimonni-language/nl_nl": "*",
"php-coveralls/php-coveralls": "^1.1",
"phpcompatibility/php-compatibility": "^9.1",
"phpcompatibility/phpcompatibility-wp": "^2.0",
"phpmd/phpmd": "^2.4",
"phpunit/phpunit": "^4.8",
"wp-coding-standards/wpcs": "^1.2",
"wimg/php-compatibility": "^9.0",
"johnpbloch/wordpress": "^5.0",
"wp-phpunit/wp-phpunit": "^5.0",
"vlucas/phpdotenv": "^2.0",
"roots/wordpress": "^5.1",
"squizlabs/php_codesniffer": "^2.9",
"phpcompatibility/phpcompatibility-wp": "^2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0"
"vlucas/phpdotenv": "^2.0",
"wp-coding-standards/wpcs": "^1.2",
"wp-phpunit/wp-phpunit": "^5.1"
},
"scripts": {
"coveralls": "vendor/bin/coveralls -v",
"phpcbf":"vendor/bin/phpcbf",
"phpcs": "vendor/bin/phpcs -s -v",
"phplint": "find src tests -name '*.php' | xargs -n 1 -P 4 php -l",
"phpmd": "vendor/bin/phpmd src,tests text phpmd.ruleset.xml --suffixes php",
"phpunit": "vendor/bin/phpunit",
"post-autoload-dump": [
"for file in languages/*.mo ; do ln -f -s ../../../../../../$file vendor/wp-phpunit/wp-phpunit/data/languages/plugins/. ; done",
"for file in vendor/koodimonni-language/*/* ; do ln -f -s ../../../../../$file vendor/wp-phpunit/wp-phpunit/data/languages/. ; done",
Expand Down
Loading

0 comments on commit 0746ad2

Please sign in to comment.