<commit_before># 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

env:
  - DB=MYSQL CORE_RELEASE=3.2

matrix:
  include:
    - php: 5.6
      env: DB=MYSQL CORE_RELEASE=3
    - php: 5.6
      env: DB=MYSQL CORE_RELEASE=3.1
    - php: 5.6
      env: DB=PGSQL CORE_RELEASE=3.2
  allow_failures:
    - php: 7.0

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

script:
  - vendor/bin/phpunit mathspamprotection/tests<commit_msg>WIP: Upgrade of Travis file<commit_after>language: php

dist: trusty

cache:
  directories:
    - $HOME/.composer/cache/files

env:
  global:
    - COMPOSER_ROOT_VERSION=4.0.x-dev

matrix:
  include:
    - php: 5.6
      env: DB=MYSQL INSTALLER_VERSION=4.0.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1
    - php: 7.0
      env: DB=PGSQL INSTALLER_VERSION=4.1.x-dev PHPUNIT_TEST=1
    - php: 7.1
      env: DB=MYSQL INSTALLER_VERSION=4.2.x-dev PHPUNIT_COVERAGE_TEST=1
    - php: 7.2
      env: DB=MYSQL INSTALLER_VERSION=4.x-dev PHPUNIT_TEST=1

before_script:
  # Init PHP
  - phpenv rehash
  - phpenv config-rm xdebug.ini

  # Install composer dependencies
  - composer validate
  - echo $INSTALLER_VERSION
  - composer require --prefer-source --no-update silverstripe/recipe-cms:1.1.x-dev
  - if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.0.x-dev; fi
  - composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
  - vendor/bin/sake flush=all

  - php vendor/silverstripe/framework/tests/dump_constants.php

script:
  - if [[ $PHPUNIT_TEST ]]; then find . | grep Sapphire && vendor/bin/phpunit tests/; fi
  - if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml tests/; fi

after_success:
  - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
{'fraction_non_alphanumeric': 0.13217072051399725, 'fraction_numerical': 0.023405231757687012, 'mean_word_length': 2.970856102003643, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3333676', 'n_tokens_mistral': 892, 'n_tokens_neox': 863, 'n_words': 172}