Skip to content

Commit 3b6debd

Browse files
committed
Move before_script and script to files
1 parent ccd05cb commit 3b6debd

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
language: php
2+
23
php:
34
- 5.3
45
- 5.4
56
- 5.5
67
- 5.6
78
- hhvm
9+
810
matrix:
911
allow_failures:
1012
- php: 5.6
1113
- php: hhvm
14+
1215
before_script:
13-
- if [[ "$TRAVIS_PHP_VERSION" == "5.4" ]]; then sh -c "php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &"; fi
14-
- if [[ "$TRAVIS_PHP_VERSION" == "5.5" ]]; then sh -c "php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &"; fi
15-
- if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then sh -c "php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &"; fi
16-
- if [[ "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then sh -c "cd tests && hhvm --mode server --port 8000 --config PHPCurlClass/server.hdf &"; fi
16+
- bash tests/before_script.sh
17+
1718
script:
18-
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
19-
- if [[ "$TRAVIS_PHP_VERSION" != "5.3" ]]; then sh -c "cd tests && phpunit --configuration phpunit.xml"; fi
19+
- bash tests/script.sh

tests/before_script.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if [[ "${TRAVIS_PHP_VERSION}" == "5.4" ]]; then
2+
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
3+
elif [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then
4+
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
5+
elif [[ "${TRAVIS_PHP_VERSION}" == "5.6" ]]; then
6+
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
7+
elif [[ "${TRAVIS_PHP_VERSION}" == "hhvm" ]]; then
8+
cd tests && hhvm --mode server --port 8000 --config PHPCurlClass/server.hdf &
9+
fi

tests/script.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
find . -type "f" -iname "*.php" | xargs -L "1" php -l
2+
3+
if [[ "${TRAVIS_PHP_VERSION}" != "5.3" ]]; then
4+
cd tests && phpunit --configuration phpunit.xml
5+
fi

0 commit comments

Comments
 (0)