@@ -23,20 +23,6 @@ branches:
2323matrix :
2424 fast_finish : true
2525 include :
26- - name : Test Install
27- php : 7.3
28- install :
29- script :
30- # Test that we find Guzzle
31- - ./tests/install.sh "will-find" "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle6-adapter"
32- # Test that we find a client with Symfony and Guzzle PSR-7
33- - ./tests/install.sh will-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug php-http/message-factory guzzlehttp/psr7:1.* http-interop/http-factory-guzzle"
34- # We should fail if we dont have php-http/message-factory or PSR-17
35- - ./tests/install.sh cant-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug php-http/message-factory guzzlehttp/psr7:1.*"
36- - ./tests/install.sh cant-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug guzzlehttp/psr7:1.* http-interop/http-factory-guzzle"
37- # We should be able to find a client when Symfony is only partly installed and we have guzzle adapter installed
38- - ./tests/install.sh will-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/guzzle6-adapter php-http/httplug php-http/message-factory guzzlehttp/psr7:1.*"
39-
4026 - name : PHPSpec code coverage
4127 php : 7.1
4228 # Disable code coverage until https://github.com/leanphp/phpspec-code-coverage/pull/38 is released
@@ -49,6 +35,37 @@ matrix:
4935 php : 7.3
5036 env : TEST_COMMAND="./vendor/bin/phpunit --group=NothingInstalled" DEPENDENCIES="phpunit/phpunit:^7.5"
5137
38+ - name : Test Install
39+ php : 7.3
40+ install :
41+ - |
42+ # install_test is a helper to create folded reports (From Symfony)
43+ install_test () {
44+ local title="./tests/install.sh \"$1\" \"$2\" \"$3\""
45+ local fold=$(date +%s%N)
46+ echo -e "travis_fold:start:$fold"
47+ echo -e "\\e[1;34m$title\\e[0m"
48+ ./tests/install.sh "$1" "$2" "$3" 2>&1
49+ local ok=$?
50+ (exit $ok) &&
51+ echo -e "\\e[32mOK\\e[0m $title\\n\\ntravis_fold:end:$fold" ||
52+ echo -e "\\e[41mKO\\e[0m $title\\n"
53+ (exit $ok)
54+ }
55+ export -f install_test
56+
57+ script :
58+ # Test that we find Guzzle
59+ - install_test "will-find" "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle6-adapter"
60+ # Test that we find a client with Symfony and Guzzle PSR-7
61+ - install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug php-http/message-factory guzzlehttp/psr7:1.* http-interop/http-factory-guzzle"
62+ # We should fail if we dont have php-http/message-factory or PSR-17
63+ - install_test cant-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug php-http/message-factory guzzlehttp/psr7:1.*"
64+ - install_test cant-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug guzzlehttp/psr7:1.* http-interop/http-factory-guzzle"
65+ # We should be able to find a client when Symfony is only partly installed and we have guzzle adapter installed
66+ - install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/guzzle6-adapter php-http/httplug php-http/message-factory guzzlehttp/psr7:1.*"
67+
68+
5269before_install :
5370 - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
5471 - if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
0 commit comments