language: php
dist: precise
matrix:
  include:
    - php: 7.1

sudo: false

script:
  - travis_wait 30 bin/simple-phpunit --coverage-clover=coverage.clover

before_script:
  - composer install
  - mysql -e 'create database fork_test'
  - mysql -u root fork_test < tests/data/test_db.sql
  - cp app/config/parameters.yml.travis app/config/parameters.yml
  - mysql -e "SET GLOBAL wait_timeout = 3600" # try to avoid mysql has gone away errors

after_script:
  - yarn test

after_success:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover

after_failure:
  - cat var/logs/test.log

jobs:
  include:
    - stage: code_quality
      php: 7.1
      script: bin/phpstan analyze src
    -
      php: 7.1
      script: bin/phpcs --standard=psr2 --extensions=php --warning-severity=0 --ignore=src/Backend/Core/Js/ckfinder,src/Backend/Cache,src/Frontend/Cache,src/Backend/Core/Js/ckeditor --report=full "src"

language: php
dist: precise
matrix:
  include:
    - php: 7.1

sudo: false

before_script:
  - composer install
  - mysql -e 'create database fork_test'
  - mysql -u root fork_test < tests/data/test_db.sql
  - cp app/config/parameters.yml.travis app/config/parameters.yml
  - mysql -e "SET GLOBAL wait_timeout = 3600" # try to avoid mysql has gone away errors

after_script:
  - yarn test

after_success:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover

after_failure:
  - cat var/logs/test.log

jobs:
  include:
    -
      php: 7.1
      script: travis_wait 30 bin/simple-phpunit --coverage-clover=coverage.clover
    - stage: code_quality
      php: 7.1
      script: bin/phpstan analyze src
    -
      php: 7.1
      script: bin/phpcs --standard=psr2 --extensions=php --warning-severity=0 --ignore=src/Backend/Core/Js/ckfinder,src/Backend/Cache,src/Frontend/Cache,src/Backend/Core/Js/ckeditor --report=full "src"

Define test stage and move existing script key to it
Define test stage and move existing script key to it
