From e5962c39b475f534f46e0104307998a63b8ef100 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 15 Jan 2021 16:28:53 +1300 Subject: [PATCH] MNT Use travis shared config, use sminnee/phpunit --- .travis.yml | 42 ++------------------- composer.json | 2 +- phpcs.xml.dist | 3 ++ tests/php/Extension/FluentExtensionTest.php | 6 +-- 4 files changed, 10 insertions(+), 43 deletions(-) diff --git a/.travis.yml b/.travis.yml index 275314c1..c244c3b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,40 +1,4 @@ -language: php +version: ~> 1.0 -dist: xenial - -services: - - mysql - -addons: - apt: - packages: - - tidy - -matrix: - include: - - php: 7.1 - env: DB=MYSQL RECIPE_VERSION=4.4.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1 - - php: 7.2 - env: DB=MYSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_COVERAGE_TEST=1 - - php: 7.3 - env: DB=MYSQL RECIPE_VERSION=4.5.x-dev PHPUNIT_TEST=1 - - php: 7.3 - env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPUNIT_TEST=1 - -before_script: - # Init PHP - - phpenv rehash - - phpenv config-rm xdebug.ini - - # Install composer dependencies - - composer validate - - composer require --no-update silverstripe/recipe-cms:"$RECIPE_VERSION" - - composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile - -script: - - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit --exclude-group exclude-from-travis; fi - - if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml --exclude-group exclude-from-travis; fi - - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/; fi - -after_success: - - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi +import: + - silverstripe/silverstripe-travis-shared:config/provision/standard-jobs-range.yml diff --git a/composer.json b/composer.json index ef11359f..cf492ed0 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "silverstripe/cms": "Localise pages" }, "require-dev": { - "phpunit/phpunit": "^5.7", + "sminnee/phpunit": "^5.7", "squizlabs/php_codesniffer": "^3" }, "extra": { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index c4c9ca11..087b850c 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -2,6 +2,9 @@ CodeSniffer ruleset for SilverStripe coding conventions. + src + tests + diff --git a/tests/php/Extension/FluentExtensionTest.php b/tests/php/Extension/FluentExtensionTest.php index 13bc3f6c..4a6469c2 100644 --- a/tests/php/Extension/FluentExtensionTest.php +++ b/tests/php/Extension/FluentExtensionTest.php @@ -341,10 +341,10 @@ public function sortRecordProvider() protected function hasLocalisedRecord(DataObject $record, $locale) { $result = SQLSelect::create() - ->setFrom($record->config()->get('table_name') . '_Localised') + ->setFrom('"' . $record->config()->get('table_name') . '_Localised"') ->setWhere([ - 'RecordID' => $record->ID, - 'Locale' => $locale, + '"RecordID"' => $record->ID, + '"Locale"' => $locale, ]) ->execute() ->first();