Skip to content

Commit

Permalink
Merge pull request #671 from creative-commoners/pull/5.0/travis-shared
Browse files Browse the repository at this point in the history
MNT Use travis shared config, use sminnee/phpunit
  • Loading branch information
tractorcow authored Feb 12, 2021
2 parents f31e2c0 + e5962c3 commit 6044c7e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 43 deletions.
42 changes: 3 additions & 39 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"silverstripe/cms": "Localise pages"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"sminnee/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3"
},
"extra": {
Expand Down
3 changes: 3 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<ruleset name="SilverStripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>

<file>src</file>
<file>tests</file>

<!-- base rules are PSR-2 -->
<rule ref="PSR2" >
<!-- Current exclusions -->
Expand Down
6 changes: 3 additions & 3 deletions tests/php/Extension/FluentExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6044c7e

Please sign in to comment.