From 3b6debd09bfb0660b219c7188813e18db83d925a Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Thu, 24 Jul 2014 10:39:35 -0700 Subject: [PATCH] Move before_script and script to files --- .travis.yml | 12 ++++++------ tests/before_script.sh | 9 +++++++++ tests/script.sh | 5 +++++ 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 tests/before_script.sh create mode 100644 tests/script.sh diff --git a/.travis.yml b/.travis.yml index 9657495..28b51cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,19 @@ language: php + php: - 5.3 - 5.4 - 5.5 - 5.6 - hhvm + matrix: allow_failures: - php: 5.6 - php: hhvm + before_script: - - if [[ "$TRAVIS_PHP_VERSION" == "5.4" ]]; then sh -c "php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &"; fi - - if [[ "$TRAVIS_PHP_VERSION" == "5.5" ]]; then sh -c "php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &"; fi - - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then sh -c "php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &"; fi - - if [[ "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then sh -c "cd tests && hhvm --mode server --port 8000 --config PHPCurlClass/server.hdf &"; fi + - bash tests/before_script.sh + script: - - find . -type "f" -iname "*.php" | xargs -L "1" php -l - - if [[ "$TRAVIS_PHP_VERSION" != "5.3" ]]; then sh -c "cd tests && phpunit --configuration phpunit.xml"; fi + - bash tests/script.sh diff --git a/tests/before_script.sh b/tests/before_script.sh new file mode 100644 index 0000000..b962158 --- /dev/null +++ b/tests/before_script.sh @@ -0,0 +1,9 @@ +if [[ "${TRAVIS_PHP_VERSION}" == "5.4" ]]; then + php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ & +elif [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then + php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ & +elif [[ "${TRAVIS_PHP_VERSION}" == "5.6" ]]; then + php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ & +elif [[ "${TRAVIS_PHP_VERSION}" == "hhvm" ]]; then + cd tests && hhvm --mode server --port 8000 --config PHPCurlClass/server.hdf & +fi diff --git a/tests/script.sh b/tests/script.sh new file mode 100644 index 0000000..44f46ac --- /dev/null +++ b/tests/script.sh @@ -0,0 +1,5 @@ +find . -type "f" -iname "*.php" | xargs -L "1" php -l + +if [[ "${TRAVIS_PHP_VERSION}" != "5.3" ]]; then + cd tests && phpunit --configuration phpunit.xml +fi