HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/apklausos/New/.travis.yml
#
# Note: If you ever need to debug Travis locally, see this
# documentation: https://docs.travis-ci.com/user/common-build-problems/#Running-a-Container-Based-Docker-Image-Locally
#

language: php
php:
    - 7.0
    - 7.1
    - 5.6
before_script:
    # Test
    #- sudo apt-get update
    #- sudo apt-get upgrade

    # disable xdebug to speed up tests
    - phpenv config-rm xdebug.ini
    # Install LimeSurvey.
    - phpunit --version
    - mysql --version
    - touch enabletests
      #- rm composer.lock
      #- rm -r third_party
    - composer install
    - chmod -R 777 tmp
    - chmod -R 777 upload
    - chmod -R 777 themes  # Need 777 so both console and web server can cd into the folder.
    - chmod -R 777 tests/tmp
    - php application/commands/console.php install admin password TravisLS no@email.com verbose
    - cp application/config/config-sample-mysql.php application/config/config.php
    # Enable debug=2 in config file. OBS: This assumes debug is on line 59.
    # TODO: Disable, a lines was added to config file and some tests started to fail.
    # - sed -i '59s/.*/        "debug"=>2,/' application/config/config.php

    # Install Apache.
    # Code fetched from https://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
    - sudo apt-get update > /dev/null
    - sudo apt-get -y --force-yes install apache2 libapache2-mod-fastcgi nodejs firefox
    - sudo cp /usr/bin/firefox /usr/local/bin/firefox
    - sudo cp /usr/bin/firefox /usr/local/bin/firefox-bin
    - which firefox
    - firefox -v
    - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
    - if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.6" ]]; then sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf; fi
    - sudo a2enmod rewrite actions fastcgi alias
    - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
    - sudo chown -R travis:travis /var/lib/apache2/fastcgi
    - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
    - sudo cp -f tests/travis/travis-ci-apache /etc/apache2/sites-available/000-default.conf
    - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
    - sudo service apache2 restart

    # Check for syntax errors.
    - find application/ -type f -name "*.php" -exec php -l {} \;  | grep -v 'No syntax errors' || true

    # Test server.
    - wget localhost
    - more localhost

    # Chromedriver setup.
    # Note: Keep getting timeout problems on Travis with chromedriver.
    #- wget https://chromedriver.storage.googleapis.com/2.33/chromedriver_linux64.zip
    #- unzip chromedriver_linux64.zip

    # Setup Selenium with Firefox headless mode.
    - wget "https://selenium-release.storage.googleapis.com/3.7/selenium-server-standalone-3.7.1.jar"
    - wget "https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-linux64.tar.gz"
    - tar xvzf geckodriver-v0.19.1-linux64.tar.gz
    - export MOZ_HEADLESS=1
    - java -jar selenium-server-standalone-3.7.1.jar -enablePassThrough false > /dev/null 2> /dev/null &

script:
    # Run tests.
    - DOMAIN=localhost phpunit # --stop-on-failure