@@ -25,8 +25,8 @@ matrix:
25
25
include :
26
26
- name : PHPSpec code coverage
27
27
php : 7.1
28
- # Disable code coverage until https://github.com/leanphp/phpspec-code-coverage/pull/38 is released
29
- # DEPENDENCIES="leanphp/phpspec-code-coverage:^4.2" TEST_COMMAND="composer test-ci"
28
+ # Disable code coverage until https://github.com/leanphp/phpspec-code-coverage/pull/38 is released
29
+ # DEPENDENCIES="leanphp/phpspec-code-coverage:^4.2" TEST_COMMAND="composer test-ci"
30
30
env : COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test" PULI_VERSION=1.0.0-beta9
31
31
- name : PHPUnit tests
32
32
php : 7.3
@@ -35,6 +35,38 @@ matrix:
35
35
php : 7.3
36
36
env : TEST_COMMAND="./vendor/bin/phpunit --group=NothingInstalled" DEPENDENCIES="phpunit/phpunit:^7.5"
37
37
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="$1 \"$2\" ..."
45
+ local fold=$(date +%s%N)
46
+ echo -e "travis_fold:start:$fold"
47
+ echo -e "\\e[1;34m$title\\e[0m"
48
+ echo "./tests/install.sh \"$1\" \"$2\" \"$3\""
49
+ ./tests/install.sh "$1" "$2" "$3" 2>&1
50
+ local ok=$?
51
+ (exit $ok) &&
52
+ echo -e "\\e[32mOK\\e[0m $title\\n\\ntravis_fold:end:$fold" ||
53
+ echo -e "\\e[41mKO\\e[0m $title\\n"
54
+ (exit $ok)
55
+ }
56
+ export -f install_test
57
+
58
+ script :
59
+ # Test that we find Guzzle
60
+ - install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle6-adapter"
61
+ # Test that we find a client with Symfony and Guzzle PSR-7
62
+ - 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"
63
+ # We should fail if we dont have php-http/message-factory or PSR-17
64
+ - install_test cant-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug php-http/message-factory guzzlehttp/psr7:1.*"
65
+ - install_test cant-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug guzzlehttp/psr7:1.* http-interop/http-factory-guzzle"
66
+ # We should be able to find a client when Symfony is only partly installed and we have guzzle adapter installed
67
+ - 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.*"
68
+
69
+
38
70
before_install :
39
71
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
40
72
- if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
0 commit comments