stages:
  - tests

phpunit:php7.1:
  stage: tests

  image: besseiit/webdev

  services:
    - mysql

  variables:
    # Configure mysql service (https://hub.docker.com/_/mysql/)
    MYSQL_ROOT_PASSWORD: typo3
    TIMEZONE: "Europe/Vienna"
    typo3DatabaseName: "testing"
    typo3DatabaseUsername: "root"
    typo3DatabasePassword: "typo3"
    typo3DatabaseHost: "mysql"

  before_script:
    # Add SSH key so we can clone private repositories (and could be useful for deployment)
    - eval $(ssh-agent -s)
    - ssh-add <(echo "$SSH_PRIVATE_KEY")
    - mkdir -p ~/.ssh
    # Disable host key verification since docker can't know the remote host (first connect)
    - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
    # Add prestissimo for faster package download
    - composer global require hirak/prestissimo

  script:
    - composer install
    - vendor/bin/phpunit -c vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml FOLDER_OF_UNIT_TESTS
    - vendor/bin/phpunit -c vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml FOLDER_OF_FUNCTIONAL_TESTS

Add .gitlab-ci demo for TYPO3 unit and functional tests
Add .gitlab-ci demo for TYPO3 unit and functional tests
