diff --git a/.travis.yml b/.travis.yml index 44a7095..5a002b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,35 @@ -# See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details - -sudo: false - language: php -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 +dist: trusty env: - - DB=MYSQL CORE_RELEASE=3.2 + global: + - COMPOSER_ROOT_VERSION=4.0.x-dev matrix: include: - php: 5.6 - env: DB=MYSQL CORE_RELEASE=3 - - php: 5.6 - env: DB=PGSQL CORE_RELEASE=3.2 - allow_failures: + env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1 - php: 7.0 + env: DB=PGSQL PHPUNIT_TEST=1 + - php: 7.1 + env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1 before_script: - - composer self-update || true - - git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support - - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss - - cd ~/builds/ss - - composer install + # Init PHP + - phpenv rehash + - phpenv config-rm xdebug.ini + + # Install composer dependencies + - composer install --prefer-dist + - composer require --prefer-dist --no-update silverstripe/recipe-framework:1.0.x-dev + - if [[ $DB == PGSQL ]]; then composer require --prefer-dist --no-update silverstripe/postgresql:2.0.x-dev; fi + - composer update script: - - vendor/bin/phpunit multiform/tests + - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; 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/README.md b/README.md index e4ca932..ac552e8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MultiForm Module -[![Build Status](https://api.travis-ci.org/silverstripe/silverstripe-multiform.svg?branch=master)](https://travis-ci.org/silverstripe/silverstripe-multiform) +[![Build Status](https://travis-ci.org/silverstripe/silverstripe-multiform.svg?branch=master)](https://travis-ci.org/silverstripe/silverstripe-multiform) [![Latest Stable Version](https://poser.pugx.org/silverstripe/multiform/version.svg)](https://github.com/silverstripe/silverstripe-multiform/releases) [![Latest Unstable Version](https://poser.pugx.org/silverstripe/multiform/v/unstable.svg)](https://packagist.org/packages/silverstripe/multiform) [![Total Downloads](https://poser.pugx.org/silverstripe/multiform/downloads.svg)](https://packagist.org/packages/silverstripe/multiform) diff --git a/_config/legacy.yml b/_config/legacy.yml index 2eaf6f9..32b046c 100644 --- a/_config/legacy.yml +++ b/_config/legacy.yml @@ -3,4 +3,5 @@ Name: multisitelegacy --- SilverStripe\ORM\DatabaseAdmin: classname_value_remapping: - MultiFormSession: SilverStripe\MultiForm\Model\MultiFormSession + MultiFormSession: SilverStripe\MultiForm\Models\MultiFormSession + MultiFormStep: SilverStripe\MultiForm\Models\MultiFormStep diff --git a/composer.json b/composer.json index 0d71251..e3ca26c 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,17 @@ "require": { "silverstripe/framework": "~3.2" }, - "license": "BSD-3-Clause", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - } + "require": { + "silverstripe/framework": "^4@dev" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.0" + }, + "license": "BSD-3-Clause", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..50e5f66 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,13 @@ + + + tests/ + + + + src/ + + tests/ + + + + diff --git a/src/tasks/MultiFormPurgeTask.php b/src/tasks/MultiFormPurgeTask.php index 0aa56fe..cdcb49a 100644 --- a/src/tasks/MultiFormPurgeTask.php +++ b/src/tasks/MultiFormPurgeTask.php @@ -1,8 +1,9 @@