diff --git a/.travis.yml b/.travis.yml index ac07cb5..82d31b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,5 +5,11 @@ php: - '7.3' - '7.4' +before_install: + - phpenv config-add tests/travis/php$TRAVIS_PHP_VERSION.ini + +install: + - export TRAVIS_PHP_VERSION; sh tests/travis/install-script.sh + script: - - vendor/bin/phpunit -c tests + - TRAVIS_SKIP_TEST=1; export TRAVIS_SKIP_TEST; sh tests/travis/run-test.sh diff --git a/tests/travis/install-script.sh b/tests/travis/install-script.sh new file mode 100644 index 0000000..de8cea6 --- /dev/null +++ b/tests/travis/install-script.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +composer install + +#case "$TRAVIS_PHP_VERSION" in +# 5\.6) composer require --dev "phpunit/phpunit 5.*" ;; +# 7\.*) composer require --dev "phpunit/phpunit 6.*" ;; +#esac diff --git a/tests/travis/php7.2.ini b/tests/travis/php7.2.ini new file mode 100644 index 0000000..1aba15a --- /dev/null +++ b/tests/travis/php7.2.ini @@ -0,0 +1,2 @@ +extension = apcu.so +apc.enable_cli = 1 diff --git a/tests/travis/php7.3.ini b/tests/travis/php7.3.ini new file mode 100644 index 0000000..077e590 --- /dev/null +++ b/tests/travis/php7.3.ini @@ -0,0 +1,3 @@ +extension = apcu.so +extension = mongodb.so +apc.enable_cli = 1 diff --git a/tests/travis/php7.4.ini b/tests/travis/php7.4.ini new file mode 100644 index 0000000..077e590 --- /dev/null +++ b/tests/travis/php7.4.ini @@ -0,0 +1,3 @@ +extension = apcu.so +extension = mongodb.so +apc.enable_cli = 1 diff --git a/tests/travis/run-test.sh b/tests/travis/run-test.sh new file mode 100644 index 0000000..067359f --- /dev/null +++ b/tests/travis/run-test.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ -e vendor/bin/phpunit ]; then + PHPUNITDIR="vendor/bin/" +else + PHPUNITDIR="" +fi +${PHPUNITDIR}phpunit -c tests