language: php
sudo: false
php:
  - 7.4
addons:
  apt:
    packages:
    - ldap-utils
    - slapd
before_script:
  - phpenv config-add tests/travis/enable-ldap.ini
  - pear upgrade pear
  - cat tests/ldapconfig.ini.dist | sed s/389/3389/ > tests/ldapconfig.ini
  - mkdir /tmp/slapd
  - slapd -f tests/ldif_data/slapd.conf -h ldap://localhost:3389 &
  - sleep 3
  - ldapadd -H ldap://localhost:3389 -D cn=admin,dc=example,dc=com -w test -f tests/ldif_data/base.ldif
  - ldapadd -H ldap://localhost:3389 -D cn=admin,dc=example,dc=com -w test -f tests/ldif_data/INITIAL_TESTDATA.ldif

script:
  - cd tests
  - phpunit .
