diff --git a/.travis.yml b/.travis.yml index 47dbad0..c912129 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,31 @@ -# See https://github.com/silverstripe/silverstripe-travis-support for setup details - -sudo: false - language: php +env: + global: + - COMPOSER_ROOT_VERSION="4.0.x-dev" + matrix: include: - php: 5.6 - env: DB=MYSQL CORE_RELEASE=4 + env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1 - php: 7.0 - env: DB=PGSQL CORE_RELEASE=4 + env: DB=PGSQL PHPUNIT_TEST=1 - php: 7.1 - env: DB=MYSQL CORE_RELEASE=4 + env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1 before_script: - - composer self-update || true - - git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support - - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss - - cd ~/builds/ss - - composer install + - phpenv rehash + - phpenv config-rm xdebug.ini + + - composer install --prefer-dist + - composer require --prefer-dist --no-update silverstripe/framework:4.0.x-dev + - if [[ $DB == PGSQL ]]; then composer require --no-update --prefer-dist silverstripe/postgresql:2.0.x-dev; fi + - composer update script: - - vendor/bin/phpunit environmentcheck/tests + - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/; fi + - if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi + - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs --standard=framework/phpcs.xml.dist src/ tests/ ; fi + +after_success: + - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..69cb760 --- /dev/null +++ b/codecov.yml @@ -0,0 +1 @@ +comment: false diff --git a/composer.json b/composer.json index fbd5c02..4d5cf7b 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,9 @@ "silverstripe/framework": "^4.0@dev" }, "require-dev": { - "silverstripe/versioned": "^1.0@dev" + "silverstripe/versioned": "^1.0@dev", + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.0" }, "extra": { "branch-alias": { @@ -30,5 +32,7 @@ "SilverStripe\\EnvironmentCheck\\": "src/", "SilverStripe\\EnvironmentCheck\\Tests\\": "tests/" } - } + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..eca2a93 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + tests + + + + + src/. + + tests/ + + + + + diff --git a/readme.md b/readme.md index 7df0200..1fcb7ea 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,8 @@ # SilverStripe Environment Checker Module -[![Build Status](http://img.shields.io/travis/silverstripe/silverstripe-environmentcheck.svg?style=flat-square)](https://travis-ci.org/silverstripe/silverstripe-environmentcheck) -[![Code Quality](http://img.shields.io/scrutinizer/g/silverstripe-labs/silverstripe-environmentcheck.svg?style=flat-square)](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-environmentcheck) -[![Code Coverage](http://img.shields.io/scrutinizer/coverage/g/silverstripe-labs/silverstripe-environmentcheck.svg?style=flat-square)](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-environmentcheck) +[![Build Status](https://travis-ci.org/silverstripe/silverstripe-environmentcheck.svg?branch=master)](https://travis-ci.org/silverstripe/silverstripe-environmentcheck) +[![Code Quality](https://scrutinizer-ci.com/g/silverstripe/silverstripe-environmentcheck/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-environmentcheck/?branch=master) +[![Code Coverage](https://codecov.io/gh/silverstripe/silverstripe-environmentcheck/branch/master/graph/badge.svg)](https://codecov.io/gh/silverstripe/silverstripe-environmentcheck) [![Version](http://img.shields.io/packagist/v/silverstripe/environmentcheck.svg?style=flat-square)](https://packagist.org/packages/silverstripe/environmentcheck) [![License](http://img.shields.io/packagist/l/silverstripe/environmentcheck.svg?style=flat-square)](LICENSE.md) diff --git a/src/EnvironmentChecker.php b/src/EnvironmentChecker.php index 204dd32..96177c3 100644 --- a/src/EnvironmentChecker.php +++ b/src/EnvironmentChecker.php @@ -280,7 +280,7 @@ class EnvironmentChecker extends RequestHandler public static function set_to_email_address($to) { Deprecation::notice('2.0', 'Use config API instead'); - static::config()->set('to_email_address', $to); + static::config()->set('to_email_address', $to); } /**