language: php

matrix:
  include:
  - php: 7.0

before_install:
  - if [[ $encrypted_98dcc32c9b33_key != '' ]]; then openssl aes-256-cbc -K $encrypted_98dcc32c9b33_key -iv $encrypted_98dcc32c9b33_iv -in auth.json.enc -out auth.json -d ; fi

before_script:
  - composer self-update
  - if [[ $encrypted_98dcc32c9b33_key != '' ]]; then composer install --prefer-source ; fi

script:
  - composer validate
  - if [[ $encrypted_98dcc32c9b33_key != '' ]]; then ./vendor/bin/phing sniff ; fi
  - if [[ $encrypted_98dcc32c9b33_key != '' ]]; then ./vendor/bin/phing unit ; fi

language: php

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

matrix:
  include:
  - php: 7.0
    env:
      - MAGE_21=true
      - MAGE_22=true
  - php: 7.1
    env:
      - MAGE_21=false
      - MAGE_22=true

before_install:
  - if [[ $encrypted_98dcc32c9b33_key != '' ]]; then openssl aes-256-cbc -K $encrypted_98dcc32c9b33_key -iv $encrypted_98dcc32c9b33_iv -in auth.json.enc -out auth.json -d ; fi

before_script:
  - composer self-update
  - composer validate

script:
  - if [[ $encrypted_98dcc32c9b33_key != '' ]]; then composer update --prefer-source ; fi
  - if [[ $encrypted_98dcc32c9b33_key != '' ]]; then ./vendor/bin/phing sniff ; fi
  - if [[ $encrypted_98dcc32c9b33_key != '' && MAGE_21 == true ]]; then composer remove magento/module-customer && composer update magento/module-customer:~100.1 ; fi
  - if [[ $encrypted_98dcc32c9b33_key != '' && MAGE_21 == true ]]; then ./vendor/bin/phing unit ; fi
  - if [[ $encrypted_98dcc32c9b33_key != '' && MAGE_22 == true ]]; then composer remove magento/module-customer && composer update magento/module-customer:~101.0 ; fi
  - if [[ $encrypted_98dcc32c9b33_key != '' && MAGE_22 == true ]]; then ./vendor/bin/phing unit ; fi

Extend Travis Build to run unit tests against Magento 2.1 and 2.2
Extend Travis Build to run unit tests against Magento 2.1 and 2.2
